Hey guys its me again [wink]. As you can see, I'm busy as a bee! Ok my question is this: Name: SDL_PollEvent -- Polls for currently pending events. Description Polls for currently pending events, and returns 1 if there are any pending events, or 0 if there are none available. If event is not NULL, the next event is removed from the queue and stored in that area. Example:
while( SDL_PollEvent(&event) )
{
// Process events
}
My question is that in my engine's loop, instead of calling SDL_PollEvent via a while loop, I am doing it via a if statement.
if ( SDL_PollEvent(&event) )
{
... Process Event...
}
else
{
... Draw Update Etc ...
}
As you can see, it will perform the same functionality as the while loop, becauseas long as there is an event, nothing will be draw, but is this correct? I was thinking I should draw every frame, whether there is a event or not, but I don't know if that is logical. I was also thinking, should I just use the while loop, or is the if/else loop faster? In the engine itself, it is only processing 2 events - event.type == SDL_QUIT and event.type == SDL_ACTIVEEVENT to know when to exit and know when *not* to draw/update. Thanks!
[Edited by - Drew_Benton on May 25, 2005 9:29:51 PM]