[SDL] SDL_PollEvent()

Peter Mulholland darkmatter at freeuk.com
Wed Nov 8 03:06:38 PST 2006


Hello pixel,

Thursday, November 2, 2006, 11:55:54 PM, you wrote:

> most of us are using SDL_PollEvent() in our "main" loop, and ive seen some
> workarounds for things like checking network traffic etc. you might as well
> just check those buffers in serial, since thats what SDL_PollEvent() does
> anyway.

> im telling you all this because i thought it was something like a  select()
> or poll() loop and wanted to make a function to add another filehandle to
> it. adding to SDL_PumpEvents might make the code cleaner to look at, but
> wouldnt really buy anything. (thought about having pumpevents go through a
> linked list of function pointers so you could just keep adding your own, but
> thats silly when you think of the final result being serially checked
> anyway)

> would making it a poll/select call be bad? or just too much work for the
> gain? i like to make light apps, that only hit the cpu when they need to by
> waiting on input until its time to swap buffers.

What about SDL_WaitEvent() ? Maybe what this function needs is a
time-out period like select() does?


-- 
Best regards,
 Peter                            mailto:darkmatter at freeuk.com





More information about the SDL mailing list