|
Engine²
Open-source game engine written in C++.
|
#include <InputManager.hpp>
Public Member Functions | |
| InputManager (Engine::Core &core) | |
| ~InputManager ()=default | |
| template<typename TCallable> | |
| FunctionUtils::FunctionID | RegisterKeyCallback (TCallable callback) |
| Register a key callback. | |
| template<typename TCallable> | |
| FunctionUtils::FunctionID | RegisterCharCallback (TCallable callback) |
| Register a char callback. | |
| template<typename TCallable> | |
| FunctionUtils::FunctionID | RegisterCharModsCallback (TCallable callback) |
| Register a char mods callback. | |
| template<typename TCallable> | |
| FunctionUtils::FunctionID | RegisterMouseButtonCallback (TCallable callback) |
| Register a mouse button callback. | |
| template<typename TCallable> | |
| FunctionUtils::FunctionID | RegisterCursorPosCallback (TCallable callback) |
| Register a cursor position callback. | |
| template<typename TCallable> | |
| FunctionUtils::FunctionID | RegisterCursorEnterCallback (TCallable callback) |
| Register a cursor enter callback. | |
| template<typename TCallable> | |
| FunctionUtils::FunctionID | RegisterScrollCallback (TCallable callback) |
| Register a scroll callback. | |
| template<typename TCallable> | |
| FunctionUtils::FunctionID | RegisterDropCallback (TCallable callback) |
| Register a drop callback. | |
| void | CallKeyCallbacks (Engine::Core &core, int key, int scancode, int action, int mods) |
| Call the key callbacks. | |
| void | CallCharCallbacks (Engine::Core &core, unsigned int codepoint) |
| Call the char callbacks. | |
| void | CallCharModsCallbacks (Engine::Core &core, unsigned int codepoint, int mods) const |
| Call the char mods callbacks. | |
| void | CallMouseButtonCallbacks (Engine::Core &core, int button, int action, int mods) const |
| Call the mouse button callbacks. | |
| void | CallCursorPosCallbacks (Engine::Core &core, double xpos, double ypos) const |
| Call the cursor position callbacks. | |
| void | CallCursorEnterCallbacks (Engine::Core &core, int entered) const |
| Call the cursor enter callbacks. | |
| void | CallScrollCallbacks (Engine::Core &core, double xoffset, double yoffset) const |
| Call the scroll callbacks. | |
| void | CallDropCallbacks (Engine::Core &core, int count, const char **paths) const |
| Call the drop callbacks. | |
| bool | DeleteKeyCallback (FunctionUtils::FunctionID id) |
| Delete a key callback. | |
| bool | DeleteCharCallback (FunctionUtils::FunctionID id) |
| Delete a char callback. | |
| bool | DeleteCharModsCallback (FunctionUtils::FunctionID id) |
| Delete a char mods callback. | |
| bool | DeleteMouseButtonCallback (FunctionUtils::FunctionID id) |
| Delete a mouse button callback. | |
| bool | DeleteCursorPosCallback (FunctionUtils::FunctionID id) |
| Delete a cursor position callback. | |
| bool | DeleteCursorEnterCallback (FunctionUtils::FunctionID id) |
| Delete a cursor enter callback. | |
| bool | DeleteScrollCallback (FunctionUtils::FunctionID id) |
| Delete a scroll callback. | |
| bool | DeleteDropCallback (FunctionUtils::FunctionID id) |
| Delete a drop callback. | |
| bool | IsKeyPressed (int key) noexcept |
Private Types | |
| using | KeyCallbackContainer = FunctionUtils::FunctionContainer<void, Engine::Core &, int, int, int, int> |
| using | CharCallbackContainer = FunctionUtils::FunctionContainer<void, Engine::Core &, unsigned int> |
| using | CharModsCallbackContainer = FunctionUtils::FunctionContainer<void, Engine::Core &, unsigned int, int> |
| using | MouseButtonCallbackContainer = FunctionUtils::FunctionContainer<void, Engine::Core &, int, int, int> |
| using | CursorPosCallbackContainer = FunctionUtils::FunctionContainer<void, Engine::Core &, double, double> |
| using | CursorEnterCallbackContainer = FunctionUtils::FunctionContainer<void, Engine::Core &, int> |
| using | ScrollCallbackContainer = FunctionUtils::FunctionContainer<void, Engine::Core &, double, double> |
| using | DropCallbackContainer = FunctionUtils::FunctionContainer<void, Engine::Core &, int, const char **> |
Private Attributes | |
| Engine::Core & | _core |
| std::shared_ptr< KeyCallbackContainer > | _keyCallbacks |
| std::shared_ptr< CharCallbackContainer > | _charCallbacks |
| std::shared_ptr< CharModsCallbackContainer > | _charModsCallbacks |
| std::shared_ptr< MouseButtonCallbackContainer > | _mouseButtonCallbacks |
| std::shared_ptr< CursorPosCallbackContainer > | _cursorPosCallbacks |
| std::shared_ptr< CursorEnterCallbackContainer > | _cursorEnterCallbacks |
| std::shared_ptr< ScrollCallbackContainer > | _scrollCallbacks |
| std::shared_ptr< DropCallbackContainer > | _dropCallbacks |
InputManager is a singleton class that wraps the GLFW callback functions.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inlineexplicit |
|
default |
|
inline |
Call the char callbacks.
| core | The core. |
| codepoint | The codepoint. (Raw input, like 'a', 'b', 'c', etc.) |
|
inline |
Call the char mods callbacks.
| core | The core. |
| codepoint | The codepoint. (Raw input, like 'a', 'b', 'c', etc.) |
| mods | The mods. (Matches with GLFW_MOD_* constants) |
|
inline |
Call the cursor enter callbacks.
| core | The core. |
| entered | The entered state. (1 if the cursor entered the window, 0 if it left) |
|
inline |
Call the cursor position callbacks.
| core | The core. |
| xpos | The x position. |
| ypos | The y position. |
|
inline |
|
inline |
Call the key callbacks.
| core | The core. |
| key | The key. (Raw input, like 'a', 'b', 'c', etc.) |
| scancode | The scancode. (Matches with GLFW_KEY_* constants) |
| action | The action. (One of GLFW_PRESS, GLFW_RELEASE, GLFW_REPEAT) |
| mods | The mods. (Matches with GLFW_MOD_* constants) |
|
inline |
Call the mouse button callbacks.
| core | The core. |
| button | The button. (Matches with GLFW_MOUSE_BUTTON_* constants) |
| action | The action. (One of GLFW_PRESS, GLFW_RELEASE) |
| mods | The mods. (Matches with GLFW_MOD_* constants) |
|
inline |
Call the scroll callbacks.
| core | The core. |
| xoffset | The x offset. |
| yoffset | The y offset. |
|
inline |
Delete a char callback.
| id | The ID of the callback to delete. |
|
inline |
Delete a char mods callback.
| id | The ID of the callback to delete. |
|
inline |
Delete a cursor enter callback.
| id | The ID of the callback to delete. |
|
inline |
Delete a cursor position callback.
| id | The ID of the callback to delete. |
|
inline |
Delete a drop callback.
| id | The ID of the callback to delete. |
|
inline |
Delete a key callback.
| id | The ID of the callback to delete. |
|
inline |
Delete a mouse button callback.
| id | The ID of the callback to delete. |
|
inline |
Delete a scroll callback.
| id | The ID of the callback to delete. |
|
inlinenoexcept |
|
inline |
Register a char callback.
| callback | The callback to register. |
|
inline |
Register a char mods callback.
| callback | The callback to register. |
|
inline |
Register a cursor enter callback.
| callback | The callback to register. |
|
inline |
Register a cursor position callback.
| callback | The callback to register. |
|
inline |
Register a drop callback.
| callback | The callback to register. |
|
inline |
Register a key callback.
| callback | The callback to register. |
|
inline |
Register a mouse button callback.
| callback | The callback to register. |
|
inline |
Register a scroll callback.
| callback | The callback to register. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |