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