1 /***************************************************************************
5 copyright : (C) 2001 by Michael Speck
6 email : kulkanie@gmx.net
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #include "lbreakout.h"
21 extern int stk_quit_request
;
24 ====================================================================
25 Event filter that blocks all events. Used to clear the SDL
27 ====================================================================
29 static int all_filter( const SDL_Event
*event
) { return 0; }
32 ====================================================================
33 Handle SDL_QUIT events directly and kill all motion events.
34 ====================================================================
36 int event_filter( const SDL_Event
*event
)
38 if ( event
->type
== SDL_QUIT
) {
42 if ( event
->type
== SDL_MOUSEMOTION
)
48 ====================================================================
49 Clear the SDL event key (keydown events)
50 ====================================================================
52 void event_clear_sdl_queue()
54 SDL_EventFilter old_filter
;
56 old_filter
= SDL_GetEventFilter();
57 SDL_SetEventFilter( all_filter
);
58 while ( SDL_PollEvent( &event
) );
59 SDL_SetEventFilter( old_filter
);