Polyphase Game Engine
Loading...
Searching...
No Matches
Input.h
Go to the documentation of this file.
1#pragma once
2
3#include "PolyphaseAPI.h"
4#include "InputConstants.h"
5#include "InputTypes.h"
6
7#include <stdint.h>
8
9// Platform Specific
13void INP_SetCursorPos(int32_t x, int32_t y);
15void INP_LockCursor(bool lock);
16void INP_TrapCursor(bool trap);
17void INP_TrapCursorToRect(int32_t x, int32_t y, int32_t w, int32_t h);
18const char* INP_ShowSoftKeyboard(bool show);
20
21// Platform Agnostic
22void INP_SetKey(int32_t key);
23void INP_ClearKey(int32_t key);
24void INP_ClearAllKeys();
25POLYPHASE_API bool INP_IsKeyDown(int32_t key);
27POLYPHASE_API bool INP_IsKeyJustDown(int32_t key);
28POLYPHASE_API bool INP_IsKeyJustUp(int32_t key);
30
31void INP_SetMouseButton(int32_t button);
32void INP_ClearMouseButton(int32_t button);
33void INP_SetScrollWheelDelta(int32_t delta);
34POLYPHASE_API bool INP_IsMouseButtonDown(int32_t button);
35POLYPHASE_API bool INP_IsMouseButtonJustDown(int32_t button);
36POLYPHASE_API bool INP_IsMouseButtonJustUp(int32_t button);
39
40void INP_SetTouch(int32_t touch);
41void INP_ClearTouch(int32_t touch);
42POLYPHASE_API bool INP_IsTouchDown(int32_t touch);
43POLYPHASE_API bool INP_IsPointerJustUp(int32_t pointer = 0);
44POLYPHASE_API bool INP_IsPointerJustDown(int32_t pointer = 0);
45POLYPHASE_API bool INP_IsPointerDown(int32_t pointer = 0);
46
47void INP_SetMousePosition(int32_t mouseX, int32_t mouseY);
48void INP_SetTouchPosition(int32_t touchX, int32_t touchY, int32_t touch = 0);
49POLYPHASE_API void INP_GetMousePosition(int32_t& mouseX, int32_t& mouseY);
50POLYPHASE_API void INP_GetTouchPosition(int32_t& touchX, int32_t& touchY, int32_t touch);
51POLYPHASE_API void INP_GetTouchPositionNormalized(float& touchX, float& touchY, int32_t touch);
52POLYPHASE_API void INP_GetPointerPosition(int32_t& pointerX, int32_t& pointerY, int32_t pointer = 0);
53POLYPHASE_API void INP_GetPointerPositionNormalized(float& pointerX, float& pointerY, int32_t pointer = 0);
54POLYPHASE_API void INP_GetMouseDelta(int32_t& deltaX, int32_t& deltaY);
55
56bool INP_IsGamepadButtonDown(int32_t gamepadButton, int32_t gamepadIndex);
57bool INP_IsGamepadButtonJustDown(int32_t gamepadButton, int32_t gamepadIndex);
58bool INP_IsGamepadButtonJustUp(int32_t gamepadButton, int32_t gamepadIndex);
59float INP_GetGamepadAxisValue(int32_t gamepadAxis, int32_t gamepadIndex);
60GamepadType INP_GetGamepadType(int32_t gamepadIndex);
61bool INP_IsGamepadConnected(int32_t gamepadIndex);
62int32_t INP_GetGamepadIndex(int32_t inputDevice);
63void INP_SetGamepadAxisValue(GamepadAxisCode axisCode, float axisValue, int32_t gamepadIndex);
64void INP_SetGamepadButton(GamepadButtonCode buttonCode, int32_t gamepadIndex);
65void INP_ClearGamepadButton(GamepadButtonCode buttonCode, int32_t gamepadIndex);
66void INP_GetGamepadGyro(float& x, float& y, float& z, int32_t gamepadIndex);
67void INP_GetGamepadAcceleration(float& x, float& y, float& z, int32_t gamepadIndex);
68void INP_GetGamepadOrientation(float& pitch, float& yaw, float& roll, int32_t gamepadIndex);
69
73
GamepadButtonCode
Definition InputTypes.h:45
GamepadAxisCode
Definition InputTypes.h:78
GamepadType
Definition InputTypes.h:22
bool INP_IsCursorLocked()
Definition Input.cpp:696
void INP_LockCursor(bool lock)
void INP_ClearAllKeys()
Definition Input.cpp:47
void INP_ClearAllMouseButtons()
Definition Input.cpp:276
void INP_Shutdown()
void INP_GetGamepadGyro(float &x, float &y, float &z, int32_t gamepadIndex)
Definition Input.cpp:650
void INP_ClearTouch(int32_t touch)
Definition Input.cpp:296
bool INP_IsCursorShown()
Definition Input.cpp:706
void INP_TrapCursor(bool trap)
void INP_SetTouchPosition(int32_t touchX, int32_t touchY, int32_t touch=0)
Definition Input.cpp:382
void INP_TrapCursorToRect(int32_t x, int32_t y, int32_t w, int32_t h)
POLYPHASE_API bool INP_IsKeyJustDown(int32_t key)
Definition Input.cpp:91
GamepadType INP_GetGamepadType(int32_t gamepadIndex)
Definition Input.cpp:565
POLYPHASE_API bool INP_IsKeyDown(int32_t key)
Definition Input.cpp:67
POLYPHASE_API void INP_GetPointerPositionNormalized(float &pointerX, float &pointerY, int32_t pointer=0)
Definition Input.cpp:452
POLYPHASE_API bool INP_IsKeyJustUp(int32_t key)
Definition Input.cpp:104
POLYPHASE_API bool INP_IsPointerJustDown(int32_t pointer=0)
Definition Input.cpp:360
void INP_GetGamepadOrientation(float &pitch, float &yaw, float &roll, int32_t gamepadIndex)
Definition Input.cpp:680
POLYPHASE_API void INP_GetTouchPosition(int32_t &touchX, int32_t &touchY, int32_t touch)
Definition Input.cpp:407
POLYPHASE_API void INP_GetMousePosition(int32_t &mouseX, int32_t &mouseY)
Definition Input.cpp:392
bool INP_IsSoftKeyboardShown()
POLYPHASE_API void INP_ShowCursor(bool show)
bool INP_IsGamepadButtonJustDown(int32_t gamepadButton, int32_t gamepadIndex)
Definition Input.cpp:500
POLYPHASE_API int32_t INP_GetScrollWheelDelta()
Definition Input.cpp:268
POLYPHASE_API char INP_ConvertKeyCodeToChar(int32_t key)
Definition Input.cpp:117
void INP_SetGamepadButton(GamepadButtonCode buttonCode, int32_t gamepadIndex)
Definition Input.cpp:630
void INP_SetScrollWheelDelta(int32_t delta)
Definition Input.cpp:222
int32_t INP_GetGamepadIndex(int32_t inputDevice)
Definition Input.cpp:587
void INP_SetGamepadAxisValue(GamepadAxisCode axisCode, float axisValue, int32_t gamepadIndex)
Definition Input.cpp:620
void INP_ClearGamepadButton(GamepadButtonCode buttonCode, int32_t gamepadIndex)
Definition Input.cpp:640
POLYPHASE_API bool INP_IsMouseButtonJustDown(int32_t button)
Definition Input.cpp:240
void INP_ClearMouseButton(int32_t button)
Definition Input.cpp:208
bool INP_IsGamepadButtonJustUp(int32_t gamepadButton, int32_t gamepadIndex)
Definition Input.cpp:522
POLYPHASE_API void INP_GetPointerPosition(int32_t &pointerX, int32_t &pointerY, int32_t pointer=0)
Definition Input.cpp:438
POLYPHASE_API void INP_GetMouseDelta(int32_t &deltaX, int32_t &deltaY)
Definition Input.cpp:466
void INP_SetCursorPos(int32_t x, int32_t y)
bool INP_IsGamepadConnected(int32_t gamepadIndex)
Definition Input.cpp:576
bool INP_IsGamepadButtonDown(int32_t gamepadButton, int32_t gamepadIndex)
Definition Input.cpp:479
bool INP_IsCursorTrapped()
Definition Input.cpp:701
void INP_SetTouch(int32_t touch)
Definition Input.cpp:288
void INP_ClearKey(int32_t key)
Definition Input.cpp:36
POLYPHASE_API bool INP_IsMouseButtonJustUp(int32_t button)
Definition Input.cpp:254
void INP_GetGamepadAcceleration(float &x, float &y, float &z, int32_t gamepadIndex)
Definition Input.cpp:665
void INP_SetMouseButton(int32_t button)
Definition Input.cpp:194
POLYPHASE_API bool INP_IsPointerJustUp(int32_t pointer=0)
Definition Input.cpp:346
POLYPHASE_API bool INP_IsTouchDown(int32_t touch)
Definition Input.cpp:322
void INP_SetMousePosition(int32_t mouseX, int32_t mouseY)
Definition Input.cpp:374
POLYPHASE_API void INP_GetTouchPositionNormalized(float &touchX, float &touchY, int32_t touch)
Definition Input.cpp:422
POLYPHASE_API bool INP_IsMouseButtonDown(int32_t button)
Definition Input.cpp:227
void INP_SetKey(int32_t key)
Definition Input.cpp:23
POLYPHASE_API bool INP_IsPointerDown(int32_t pointer=0)
Definition Input.cpp:332
float INP_GetGamepadAxisValue(int32_t gamepadAxis, int32_t gamepadIndex)
Definition Input.cpp:544
const char * INP_ShowSoftKeyboard(bool show)
POLYPHASE_API bool INP_IsKeyJustDownRepeat(int32_t key)
Definition Input.cpp:79
void INP_Initialize()
void INP_Update()
Export macros for Polyphase Engine symbols.
#define POLYPHASE_API
Definition PolyphaseAPI.h:31