chickadee » sdl2 » poll-event!

poll-event! #!optional result-eventprocedure

Get the next event from the event queue. The returned event is removed from the event queue. See SDL_PollEvent.

If result-event is omitted or #f, a new managed sdl2:event will be returned. If result-event is an sdl2:event, it will be modified and returned. This allows you to allocate a single event and reuse it many times in your event loop, so that your program does not create as much garbage for the garbage collector.