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 nil, the next event is removed from the queue and stored in that area.
event : TSDL_Event; // Event structure
.
.
.
// Check for events
while ( SDL_PollEvent( @event ) ) do
begin // Loop until there are no events left on the queue
case event.type_ of // Process the appropiate event type
SDL_KEYDOWN: // Handle a KEYDOWN event
begin
printf("Oh! Key press\n");
end;
SDL_MOUSEMOTION:
begin
.
.
.
end;
else // Report an unhandled event
printf("I don't know what this event is!\n");
end;
end;