src/events/SDL_events.c
changeset 10106 d240baef8248
parent 10060 739bc5c7d339
equal deleted inserted replaced
10105:c59a7e780093 10106:d240baef8248
   433     for (;;) {
   433     for (;;) {
   434         SDL_PumpEvents();
   434         SDL_PumpEvents();
   435         switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) {
   435         switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) {
   436         case -1:
   436         case -1:
   437             return 0;
   437             return 0;
   438         case 1:
       
   439             return 1;
       
   440         case 0:
   438         case 0:
   441             if (timeout == 0) {
   439             if (timeout == 0) {
   442                 /* Polling and no events, just return */
   440                 /* Polling and no events, just return */
   443                 return 0;
   441                 return 0;
   444             }
   442             }
   446                 /* Timeout expired and no events */
   444                 /* Timeout expired and no events */
   447                 return 0;
   445                 return 0;
   448             }
   446             }
   449             SDL_Delay(10);
   447             SDL_Delay(10);
   450             break;
   448             break;
       
   449         default:
       
   450             /* Has events */
       
   451             return 1;
   451         }
   452         }
   452     }
   453     }
   453 }
   454 }
   454 
   455 
   455 int
   456 int