3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
8 * See LICENSING which should be included
9 * along with this file for more details
12 #ifndef __FELIB_WHANDLER_H__
13 #define __FELIB_WHANDLER_H__
21 #define GET_KEY globalwindowhandler::GetKey
22 #define READ_KEY globalwindowhandler::ReadKey
23 #define GET_TICK globalwindowhandler::GetTick
24 #define DELAY globalwindowhandler::Delay
27 class globalwindowhandler
{
29 static void KSDLProcessEvents (truth dodelay
=false);
30 static void KSDLWaitEvent ();
31 static int GetKey (truth EmptyBuffer
=true);
32 static int ReadKey ();
33 static void InstallControlLoop (truth (*What
)());
34 static void DeInstallControlLoop (truth (*What
)());
35 static feuLong
GetTick () { return Tick
; }
36 static truth
ControlLoopsInstalled () { return Controls
; }
37 static void EnableControlLoops () { ControlLoopsEnabled
= true; }
38 static void DisableControlLoops () { ControlLoopsEnabled
= false; }
39 static truth
ShiftIsDown ();
41 static void SetQuitMessageHandler (truth (*What
)()) { QuitMessageHandler
= What
; }
42 static feuLong
UpdateTick () { return Tick
= SDL_GetTicks()/40; }
44 static void Delay (int ms
);
47 static void ProcessMessage (SDL_Event
*Event
);
49 static std::vector
<int> KeyBuffer
;
50 static truth (*QuitMessageHandler
)();
51 static truth (*ControlLoop
[MAX_CONTROLS
])();
54 static truth ControlLoopsEnabled
;
56 static Uint32 nextGameTick
;