Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
GlfwInput.h
Go to the documentation of this file.
1#pragma once
2
4
5#include "ThirdParty/GLFW3.h"
6
7#include <array>
8
9namespace ph::editor
10{
11
12class Editor;
13
15{
16public:
17 static const std::array<EKeyCode, GLFW_KEY_LAST + 1>& GLFW_TO_PHOTON_KEYCODE();
18 static const std::array<EMouseCode, GLFW_MOUSE_BUTTON_LAST + 1>& GLFW_TO_PHOTON_MOUSECODE();
19
20public:
21 GlfwInput();
22 ~GlfwInput() override;
23
24 void poll(float64 deltaS) override;
25
26 void virtualizeCursor() const override;
27 void unvirtualizeCursor() const override;
28
29 bool isKeyDown(EKeyCode keyCode) const override;
30 bool isMouseButtonDown(EMouseCode mouseCode) const override;
31
32 bool isKeyUp(EKeyCode keyCode) const override;
33 bool isMouseButtonUp(EMouseCode mouseCode) const override;
34
35 bool isKeyHold(EKeyCode keyCode) const override;
36 bool isMouseButtonHold(EMouseCode mouseCode) const override;
37
38 math::Vector2D getCursorPositionPx() const override;
39 math::Vector2D getCursorMovementDeltaPx() const override;
40
41 void initialize(Editor& editor, GLFWwindow* glfwWindow);
42 void terminate();
43
44private:
45 GLFWwindow* m_glfwWindow;
46};
47
48}// end namespace ph::editor
Definition Editor.h:45
Definition GlfwInput.h:15
bool isKeyHold(EKeyCode keyCode) const override
Definition GlfwInput.cpp:65
void terminate()
Definition GlfwInput.cpp:130
static const std::array< EMouseCode, GLFW_MOUSE_BUTTON_LAST+1 > & GLFW_TO_PHOTON_MOUSECODE()
Definition GlfwInput.cpp:214
bool isKeyDown(EKeyCode keyCode) const override
Definition GlfwInput.cpp:41
bool isKeyUp(EKeyCode keyCode) const override
Definition GlfwInput.cpp:53
GlfwInput()
Definition GlfwInput.cpp:17
void poll(float64 deltaS) override
Definition GlfwInput.cpp:24
void virtualizeCursor() const override
Definition GlfwInput.cpp:31
math::Vector2D getCursorMovementDeltaPx() const override
Definition GlfwInput.cpp:83
bool isMouseButtonDown(EMouseCode mouseCode) const override
Definition GlfwInput.cpp:47
bool isMouseButtonHold(EMouseCode mouseCode) const override
Definition GlfwInput.cpp:71
static const std::array< EKeyCode, GLFW_KEY_LAST+1 > & GLFW_TO_PHOTON_KEYCODE()
Definition GlfwInput.cpp:208
void unvirtualizeCursor() const override
Definition GlfwInput.cpp:36
bool isMouseButtonUp(EMouseCode mouseCode) const override
Definition GlfwInput.cpp:59
math::Vector2D getCursorPositionPx() const override
Definition GlfwInput.cpp:77
void initialize(Editor &editor, GLFWwindow *glfwWindow)
Definition GlfwInput.cpp:89
Platform input abstraction.
Definition PlatformInput.h:18
Definition ph_editor.h:10
EMouseCode
Definition EMouseCode.h:9
EKeyCode
Definition EKeyCode.h:9