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
3
#include "
Platform/PlatformInput.h
"
4
5
#include "
ThirdParty/GLFW3.h
"
6
7
#include <array>
8
9
namespace
ph::editor
10
{
11
12
class
Editor;
13
14
class
GlfwInput
:
public
PlatformInput
15
{
16
public
:
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
20
public
:
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
44
private
:
45
GLFWwindow* m_glfwWindow;
46
};
47
48
}
// end namespace ph::editor
GLFW3.h
PlatformInput.h
ph::editor::Editor
Definition
Editor.h:45
ph::editor::GlfwInput
Definition
GlfwInput.h:15
ph::editor::GlfwInput::isKeyHold
bool isKeyHold(EKeyCode keyCode) const override
Definition
GlfwInput.cpp:65
ph::editor::GlfwInput::terminate
void terminate()
Definition
GlfwInput.cpp:130
ph::editor::GlfwInput::GLFW_TO_PHOTON_MOUSECODE
static const std::array< EMouseCode, GLFW_MOUSE_BUTTON_LAST+1 > & GLFW_TO_PHOTON_MOUSECODE()
Definition
GlfwInput.cpp:214
ph::editor::GlfwInput::isKeyDown
bool isKeyDown(EKeyCode keyCode) const override
Definition
GlfwInput.cpp:41
ph::editor::GlfwInput::isKeyUp
bool isKeyUp(EKeyCode keyCode) const override
Definition
GlfwInput.cpp:53
ph::editor::GlfwInput::GlfwInput
GlfwInput()
Definition
GlfwInput.cpp:17
ph::editor::GlfwInput::poll
void poll(float64 deltaS) override
Definition
GlfwInput.cpp:24
ph::editor::GlfwInput::virtualizeCursor
void virtualizeCursor() const override
Definition
GlfwInput.cpp:31
ph::editor::GlfwInput::getCursorMovementDeltaPx
math::Vector2D getCursorMovementDeltaPx() const override
Definition
GlfwInput.cpp:83
ph::editor::GlfwInput::isMouseButtonDown
bool isMouseButtonDown(EMouseCode mouseCode) const override
Definition
GlfwInput.cpp:47
ph::editor::GlfwInput::~GlfwInput
~GlfwInput() override
ph::editor::GlfwInput::isMouseButtonHold
bool isMouseButtonHold(EMouseCode mouseCode) const override
Definition
GlfwInput.cpp:71
ph::editor::GlfwInput::GLFW_TO_PHOTON_KEYCODE
static const std::array< EKeyCode, GLFW_KEY_LAST+1 > & GLFW_TO_PHOTON_KEYCODE()
Definition
GlfwInput.cpp:208
ph::editor::GlfwInput::unvirtualizeCursor
void unvirtualizeCursor() const override
Definition
GlfwInput.cpp:36
ph::editor::GlfwInput::isMouseButtonUp
bool isMouseButtonUp(EMouseCode mouseCode) const override
Definition
GlfwInput.cpp:59
ph::editor::GlfwInput::getCursorPositionPx
math::Vector2D getCursorPositionPx() const override
Definition
GlfwInput.cpp:77
ph::editor::GlfwInput::initialize
void initialize(Editor &editor, GLFWwindow *glfwWindow)
Definition
GlfwInput.cpp:89
ph::editor::PlatformInput
Platform input abstraction.
Definition
PlatformInput.h:18
ph::editor
Definition
ph_editor.h:10
ph::editor::EMouseCode
EMouseCode
Definition
EMouseCode.h:9
ph::editor::EKeyCode
EKeyCode
Definition
EKeyCode.h:9
Source
Platform
GlfwPlatform
GlfwInput.h
Generated by
1.11.0