src/events/SDL_events.c
changeset 352 b49fc922e7f6
parent 297 f6ffac90895c
child 353 d47637068e52
equal deleted inserted replaced
351:b1cae30740a2 352:b49fc922e7f6
   370 
   370 
   371 int SDL_PollEvent (SDL_Event *event)
   371 int SDL_PollEvent (SDL_Event *event)
   372 {
   372 {
   373 	SDL_PumpEvents();
   373 	SDL_PumpEvents();
   374 
   374 
   375 	return(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS));
   375 	/* We can't return -1, just return 0 (no event) on error */
       
   376 	if ( SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS) <= 0 )
       
   377 		return 0;
       
   378 	return 1;
   376 }
   379 }
   377 
   380 
   378 int SDL_WaitEvent (SDL_Event *event)
   381 int SDL_WaitEvent (SDL_Event *event)
   379 {
   382 {
   380 	while ( 1 ) {
   383 	while ( 1 ) {