NWengine 0.9
Loading...
Searching...
No Matches
Inputs.h
Go to the documentation of this file.
1
6#pragma once
7#include "Maths.h"
8
13#define INPUT_LEFT_X 0
14
19#define INPUT_LEFT_Y 1
20
25#define INPUT_RIGHT_X 3
26
31#define INPUT_RIGHT_Y 4
32
37typedef int Input_Number;
38
43typedef int Input_Mode;
44
49class Inputs {
50public:
54 static double mousePosX;
55
59 static double mousePosY;
60
64 static bool left;
65
69 static bool right;
70
74 static bool up;
75
79 static bool down;
80
84 static bool d;
85
89 static bool r;
90
94 static bool s;
95
99 static bool t;
100
104 static bool ctrl;
105
109 static bool left_ctrl;
110
114 static bool right_ctrl;
115
119 static bool left_click;
120
124 static bool n_0;
125
129 static bool n_1;
130
134 static bool n_2;
135
139 static bool n_3;
140
144 static bool n_4;
145
149 static bool enter;
150
154 static bool f2;
155
159 static bool space;
160
164 static bool usingJoystick;
165
170 static void Process(void* window);
171
178 static bool GetInputKey(Input_Number key, Input_Mode mode);
179
186 static bool GetInputMouse(Input_Number key, Input_Mode mode);
187
191 static float joystickAxis[6];
192};
int Input_Mode
Alias for the input mode type.
Definition Inputs.h:43
int Input_Number
Alias for the input number type.
Definition Inputs.h:37
The Inputs class represents the input state and provides methods to process and retrieve input.
Definition Inputs.h:49
static bool enter
Flag indicating if the enter input key is pressed.
Definition Inputs.h:149
static bool right_ctrl
Flag indicating if the right control input key is pressed.
Definition Inputs.h:114
static bool n_4
Flag indicating if the 4 input key is pressed.
Definition Inputs.h:144
static bool ctrl
Flag indicating if the control input key is pressed.
Definition Inputs.h:104
static void Process(void *window)
Process the input events.
Definition Inputs.cpp:38
static bool left_ctrl
Flag indicating if the left control input key is pressed.
Definition Inputs.h:109
static double mousePosY
The Y-coordinate of the mouse position.
Definition Inputs.h:59
static bool down
Flag indicating if the down input key is pressed.
Definition Inputs.h:79
static bool left_click
Flag indicating if the left mouse button is clicked.
Definition Inputs.h:119
static double mousePosX
The X-coordinate of the mouse position.
Definition Inputs.h:54
static float joystickAxis[6]
The array of joystick axis values.
Definition Inputs.h:22
static bool t
Flag indicating if the t input key is pressed.
Definition Inputs.h:99
static bool usingJoystick
Flag indicating if a joystick is being used.
Definition Inputs.h:164
static bool GetInputKey(Input_Number key, Input_Mode mode)
Get the state of the specified input key.
Definition Inputs.cpp:24
static bool up
Flag indicating if the up input key is pressed.
Definition Inputs.h:74
static bool n_1
Flag indicating if the 1 input key is pressed.
Definition Inputs.h:129
static bool f2
Flag indicating if the F2 input key is pressed.
Definition Inputs.h:154
static bool s
Flag indicating if the s input key is pressed.
Definition Inputs.h:94
static bool space
Flag indicating if the space input key is pressed.
Definition Inputs.h:159
static bool left
Flag indicating if the left input key is pressed.
Definition Inputs.h:64
static bool n_3
Flag indicating if the 3 input key is pressed.
Definition Inputs.h:139
static bool right
Flag indicating if the right input key is pressed.
Definition Inputs.h:69
static bool d
Flag indicating if the d input key is pressed.
Definition Inputs.h:84
static bool GetInputMouse(Input_Number key, Input_Mode mode)
Get the state of the specified mouse input.
Definition Inputs.cpp:34
static bool n_2
Flag indicating if the 2 input key is pressed.
Definition Inputs.h:134
static bool n_0
Flag indicating if the 0 input key is pressed.
Definition Inputs.h:124
static bool r
Flag indicating if the r input key is pressed.
Definition Inputs.h:89