Fixed SDL_PollEvent() so it only returns a boolean value (not -1)

This commit is contained in:
Sam Lantinga
2002-04-15 04:51:26 +00:00
parent c6a0b5febd
commit c95c828be1

View File

@@ -372,7 +372,10 @@ int SDL_PollEvent (SDL_Event *event)
{
SDL_PumpEvents();
return(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS));
/* We can't return -1, just return 0 (no event) on error */
if ( SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS) <= 0 )
return 0;
return 1;
}
int SDL_WaitEvent (SDL_Event *event)