Plasma Engine  2.0
Loading...
Searching...
No Matches
InputDevice_glfw.h
1#pragma once
2
3#include <Core/Input/DeviceTypes/MouseKeyboard.h>
4
5extern "C"
6{
7 typedef struct GLFWwindow GLFWwindow;
8}
9
11{
12 PL_ADD_DYNAMIC_REFLECTION(plStandardInputDevice, plInputDeviceMouseKeyboard);
13
14public:
15 plStandardInputDevice(plUInt32 uiWindowNumber, GLFWwindow* windowHandle);
17
18 virtual void SetShowMouseCursor(bool bShow) override;
19 virtual bool GetShowMouseCursor() const override;
22
23 // GLFW callback for key pressed, released, repeated events
24 void OnKey(int key, int scancode, int action, int mods);
25
26 // GLFW callback for text input (each UTF32 code point individually)
27 void OnCharacter(unsigned int codepoint);
28
29 // GLFW callback on mouse move
30 void OnCursorPosition(double xpos, double ypos);
31
32 // GLFW callback on mouse button actions
33 void OnMouseButton(int button, int action, int mods);
34
35 // GLFW callback for mouse scroll
36 void OnScroll(double xoffset, double yoffset);
37
38private:
39 virtual void InitializeDevice() override;
40 virtual void RegisterInputSlots() override;
41 virtual void ResetInputSlotValues() override;
42
43private:
44 plUInt32 m_uiWindowNumber = 0;
45 GLFWwindow* m_pWindow = nullptr;
47};
This is the base class for all input devices that handle mouse and keyboard input.
Definition MouseKeyboard.h:26
Android standard input device.
Definition InputDevice_android.h:10
virtual bool GetShowMouseCursor() const override
Returns whether the mouse cursor is shown.
virtual void RegisterInputSlots() override
Override this to register all the input slots that this device exposes.
virtual void InitializeDevice() override
Override this if you need to do device specific initialization before the first use.
virtual void ResetInputSlotValues() override
Override this, if you need to reset certain input slot values to zero, after the plInputManager is fi...
virtual void SetShowMouseCursor(bool bShow) override
Shows or hides the mouse cursor inside the application window.
virtual plMouseCursorClipMode::Enum GetClipMouseCursor() const override
Returns whether the mouse is confined to the application window or not.
virtual void SetClipMouseCursor(plMouseCursorClipMode::Enum mode) override
Will trap the mouse inside the application window. Should usually be enabled, to prevent accidental t...
constexpr TYPE MaxValue()
Returns the largest possible positive value (that is not infinity).
Enum
Definition MouseKeyboard.h:10