|
CeresEngine 0.2.0
A game development framework
|
#include <CeresEngine/Platform/GLFW/GLFWWindow.hpp>
Classes | |
| struct | DragState |
Public Types | |
| enum class | API { OpenGL , None } |
Public Member Functions | |
| GLFWWindow (double width=800.0, double height=600.0, const String &title="Game Engine", API api=API::None) | |
| Create a new GLFW window. | |
| GLFWWindow (const GLFWWindow &)=delete | |
| GLFWWindow & | operator= (const GLFWWindow &)=delete |
| ~GLFWWindow () final | |
| Destroys the GLFW window. | |
| void | activate () final |
| void | deactivate () final |
| String | getTitle () const final |
| void | setTitle (const String &title) final |
| Vector2 | getSize () const final |
| void | resize (double width, double height) final |
| void | close () final |
| bool | isFullscreen () const final |
| void | setFullscreen (bool fullscreen) final |
| double | getScalingFactor () const final |
| GLFWwindow * | getHandle () const |
Public Member Functions inherited from CeresEngine::PlatformWindow | |
| PlatformWindow (const PlatformWindowProperties &properties) | |
| virtual | ~PlatformWindow ()=default |
| void | resize (const Vector2 size) |
| Resizes the window. | |
| void | sendEvent (const AnyInputEvent &event) |
| Sends a new event through the window. | |
Static Public Member Functions | |
| static Vector< const char * > | getVulkanInstanceExtensions () |
| static GLFWWindow * | fromHandle (GLFWwindow *handle) |
| Gets the GLFWWindow from the given GLFW handle. | |
Private Member Functions | |
| void | keyboardCallback (int key, int scancode, int action, int modifiers) |
| A callback method called by GLFW when a keyboard button is pressed. | |
| void | charCallback (int unicodeChar) |
| A callback method called by GLFW when a keyboard button is pressed and inputs text. | |
| void | mouseButtonCallback (int button, int action, int modifiers) |
| A callback method called by GLFW when a mouse button is pressed. | |
| void | mousePositionCallback (double x, double y) |
| A callback method called by GLFW when the mouse changes position. | |
| void | mouseScrollCallback (double x, double y) |
| A callback method called by GLFW when the mouse scroll wheel position changes. | |
Private Attributes | |
| GLFWwindow * | mWindow |
| The GLFW window handle. | |
| PlatformWindowProperties | mProperties |
| String | mTitle |
| The window title. | |
| HashMap< Button, DragState > | mDragStates |
| ModifierButton | mModifierButtons |
| InputState | mState |
| The. | |
Additional Inherited Members | |
Public Attributes inherited from CeresEngine::PlatformWindow | |
| const PlatformWindowProperties & | properties |
| Generates a hash for the provided type. | |
| Event< void(PlatformWindow &, Vector2)> | didResize |
| A signal that gets dispatched whenever the window gets resized. | |
| Event< void(PlatformWindow &)> | didClose |
| A signal that gets dispatched whenever the window gets closed. | |
| Event< void(const AnyInputEvent &)> | onEvent |
| An event fired when any input event is received on the window. | |
| Event< void(const KeyEvent &)> | onKeyDown |
| An event fired when a key down event is received. | |
| Event< void(const KeyEvent &)> | onKeyUp |
| An event fired when a key up event is received. | |
| Event< void(const MouseEvent &)> | onMouseDown |
| An event fired when a mouse down event is received. | |
| Event< void(const MouseEvent &)> | onMouseUp |
| An event fired when a mouse up event is received. | |
| Event< void(const MouseEvent &)> | onMouseMove |
| An event fired when a mouse move event is received. | |
| Event< void(const MouseEvent &)> | onMouseDrag |
| An event fired when a mouse drag eent is received. | |
| Event< void(const MouseEvent &)> | onMouseScroll |
| An event fired when a mouse scroll event is received. | |
| Event< void(const TextEvent &)> | onTextInput |
| An event fired when a text input event is received. | |
| Event< void(const Rect2 &newRect, const Rect2 &oldRect)> | didChangeFrame |
| Event< bool()> | windowShouldClose |
|
explicit |
Create a new GLFW window.
| width | The window initial width |
| height | The window initial height |
| title | The window initial title |
| api | The graphics API to request to the system |
|
delete |
|
final |
Destroys the GLFW window.
|
finalvirtual |
Implements CeresEngine::PlatformWindow.
A callback method called by GLFW when a keyboard button is pressed and inputs text.
| unicodeChar | The character unicode. |
|
finalvirtual |
Implements CeresEngine::PlatformWindow.
|
finalvirtual |
Implements CeresEngine::PlatformWindow.
|
static |
Gets the GLFWWindow from the given GLFW handle.
| handle | The GLFW handle |
| GLFWwindow * CeresEngine::GLFWWindow::getHandle | ( | ) | const |
|
finalvirtual |
Implements CeresEngine::PlatformWindow.
|
finalvirtual |
Implements CeresEngine::PlatformWindow.
|
finalvirtual |
Implements CeresEngine::PlatformWindow.
|
finalvirtual |
Implements CeresEngine::PlatformWindow.
|
private |
A callback method called by GLFW when a keyboard button is pressed.
| key | The GLFW key code |
| scancode | The operating system key scan code |
| action | The key action (press, release or repeat) |
| modifiers | The modifiers pressed with the keys |
A callback method called by GLFW when a mouse button is pressed.
| button | The GLFW mouse button code |
| action | The button action (press or release) |
| modifiers | The modifiers pressed with the buttons |
A callback method called by GLFW when the mouse changes position.
| x | The X coordinate |
| y | The Y coordinate |
A callback method called by GLFW when the mouse scroll wheel position changes.
| x | The X coordinate |
| y | The Y coordinate |
|
delete |
Implements CeresEngine::PlatformWindow.
Implements CeresEngine::PlatformWindow.
Implements CeresEngine::PlatformWindow.
|
private |
|
private |
|
private |
The.
|
private |
The window title.
|
private |
The GLFW window handle.