Fix for initialization of scalos preferences library. Library is now loaded only...
[AROS-Contrib.git] / Games / lbreakout2 / client / event.c
blob331b80391cb049288b556d05c5101ec9a1da69a5
1 /***************************************************************************
2 event.c - description
3 -------------------
4 begin : Sat Sep 8 2001
5 copyright : (C) 2001 by Michael Speck
6 email : kulkanie@gmx.net
7 ***************************************************************************/
9 /***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
18 #include "lbreakout.h"
19 #include "event.h"
21 extern int stk_quit_request;
24 ====================================================================
25 Event filter that blocks all events. Used to clear the SDL
26 event queue.
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 ) {
39 stk_quit_request = 1;
40 return 0;
42 if ( event->type == SDL_MOUSEMOTION )
43 return 0;
44 return 1;
48 ====================================================================
49 Clear the SDL event key (keydown events)
50 ====================================================================
52 void event_clear_sdl_queue()
54 SDL_EventFilter old_filter;
55 SDL_Event event;
56 old_filter = SDL_GetEventFilter();
57 SDL_SetEventFilter( all_filter );
58 while ( SDL_PollEvent( &event ) );
59 SDL_SetEventFilter( old_filter );