mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 13:21:04 +00:00
d3b506eb2b
* Breaks every other game except Duke unless/until they get migrated. Done for the purpose of demonstrating PR #244. # Conflicts: # source/build/src/timer.cpp # source/games/duke/src/game.cpp
66 lines
1 KiB
C++
66 lines
1 KiB
C++
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include "compat.h"
|
|
#include "printf.h"
|
|
#include "c_dispatch.h"
|
|
#include "tarray.h"
|
|
#include "scancodes.h"
|
|
#include "c_bind.h"
|
|
#include "c_buttons.h"
|
|
#include "d_event.h"
|
|
#include "m_joy.h"
|
|
#include "gamecvars.h"
|
|
|
|
|
|
struct ControlInfo
|
|
{
|
|
float dx;
|
|
float dy;
|
|
float dz;
|
|
float dyaw;
|
|
float dpitch;
|
|
float droll;
|
|
float mousex;
|
|
float mousey;
|
|
};
|
|
|
|
|
|
class InputState
|
|
{
|
|
uint8_t KeyStatus[NUM_KEYS];
|
|
bool AnyKeyStatus;
|
|
vec2f_t g_mousePos;
|
|
|
|
public:
|
|
|
|
bool ShiftPressed()
|
|
{
|
|
return KeyStatus[sc_LeftShift] || KeyStatus[sc_RightShift];
|
|
}
|
|
|
|
void AddEvent(const event_t* ev);
|
|
|
|
void MouseAddToPos(float x, float y)
|
|
{
|
|
g_mousePos.x += x;
|
|
g_mousePos.y += y;
|
|
}
|
|
|
|
void GetMouseDelta(ControlInfo* info);
|
|
|
|
void ClearAllInput();
|
|
bool CheckAllInput()
|
|
{
|
|
bool res = AnyKeyStatus;
|
|
AnyKeyStatus = false;
|
|
return res;
|
|
}
|
|
};
|
|
|
|
extern InputState inputState;
|
|
|
|
void (*timerSetCallback(void (*callback)(void)))(void);
|
|
|
|
void CONTROL_GetInput(ControlInfo* info);
|
|
int32_t handleevents(void);
|