-
Notifications
You must be signed in to change notification settings - Fork 1
/
inputhandler.h
38 lines (29 loc) · 869 Bytes
/
inputhandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include "gamedefs.h"
// -------------------------------------------------------------------------------------------------
enum {
BUTTON_FORWARD,
BUTTON_BACKWARD,
BUTTON_LEFT,
BUTTON_RIGHT,
BUTTON_FIRE,
BUTTON_CONFIRM,
BUTTON_GODMODE,
NUM_CONTROLS
};
// -------------------------------------------------------------------------------------------------
class InputHandler
{
public:
InputHandler(Game *game);
~InputHandler(void);
float GetSteering(void) const;
float GetAcceleration(void) const;
bool IsFiring(void) const;
bool IsPressingConfirm(void) const;
bool IsPressingGodmodeButton(void) const;
private:
static bool TogglePause(uint32_t key, bool pressed, void *context);
static bool ShowEditor(uint32_t key, bool pressed, void *context);
static bool ToggleOverrideRenderBuffer(uint32_t key, bool pressed, void *context);
};