Hi, Am Donnerstag, 19. Februar 2004 05:45 schrieb chromatic: > On Fri, 2004-02-13 at 09:21, Jens Rieks wrote: > > This patch fixes _SDL_WaitEvent a bit; SDL_WaitEvent returns an integer > > and not a SDL_Event. > > It also introduces _SDL_PollEvent which is mostly a copy of > > _SDL_WaitEvent. Finally, _SDL_loop is modified to allow an "idle" event > > entry that gets called if no events are pending. If such an event is > > defined, _SDL_PollEvent is used to check whether events are pending. The > > idle callback is made every 50ms, "timer callback" might be a better > > name. > > Thanks, applied with a few tweaks. Their is a "branch _poll" missing after the _idle block. Without it, _SDL_WaitEvent is called after the first idle call. A patch is attached.
> We can figure out a slightly nicer interface as we start to use it in > real PIR programs -- and from higher level languages. > > > It is also necessary to add code for SDL_PollEvent to library/sdl.pasm. > > Done. > > > I propose to rename this file to sdl_init.pasm; I'am working on a sdl.imc > > file that makes it much easier to use SDL with PIR, because it hides much > > of the 'internals'. I will send the file to the list in a few minutes > > (the documentation if not yet sufficient at the moment). > > I'm not sure of the best way to organize these. Maybe we should wait > until object support improves. On the other hand, I would like to see > how Perl 6 or Pirate would call these libraries before commiting one way > or the other. > -- c jens
Index: sdl_types.imc =================================================================== RCS file: /cvs/public/parrot/library/sdl_types.imc,v retrieving revision 1.7 diff -u -w -r1.7 sdl_types.imc --- sdl_types.imc 19 Feb 2004 04:42:02 -0000 1.7 +++ sdl_types.imc 20 Feb 2004 01:35:15 -0000 @@ -441,6 +441,7 @@ time nexttime add nexttime, 0.05 + branch _poll _wait: event = _SDL_WaitEvent()