/*
* call-seq:
* get_sdl -> [Event, ...]
*
* (This private method is intended for internal use, but you might need
* to worry about it if you extend Queue.)
*
* Retrieves all pending events from SDL's event buffer and converts them
* into Rubygame Event objects. Returns an Array of all the events, in
* the order they were read.
*/
VALUE rbgm_queue_getsdl(VALUE self)
{
SDL_Event event;
VALUE event_array;
event_array = rb_ary_new();
/* put each in *event until no pending events are in SDL's queue */
/* for now, we don't care what type the event in. Filtering comes later */
while(SDL_PollEvent(&event)==1)
{
rb_ary_push(event_array, rbgm_convert_sdlevent(event) );
}
return event_array;
}