![]() |
undoStudio
The IDE of the undoRT ecosystem
|
GLFW implementation of WindowService. More...


Public Member Functions | |
| WindowServiceGLFW ()=default | |
| ~WindowServiceGLFW () override=default | |
| bool | initialize (const WindowConfig &config) override |
| Initialize GLFW and create a window. | |
| void | shutdown () override |
| Shutdown GLFW and destroy the window. | |
| bool | shouldClose () const override |
| Check if window close event has been triggered. | |
| void | pollEvents () override |
| Poll and process all pending events. | |
| void | swapBuffers () override |
| Swap the OpenGL front and back buffers. | |
| glm::ivec2 | getWindowSize () const override |
| Get current window size. | |
| void | setWindowSize (int width, int height) override |
| Set window size. | |
| void | setTitle (const std::string &title) override |
| Set window title. | |
| void * | getNativeHandle () const override |
| Get native GLFW window handle. | |
| void | setResizeCallback (ResizeCallback callback) override |
| Set the window resize callback. | |
| void | setKeyCallback (KeyCallback callback) override |
| Set the keyboard input callback. | |
| void | setMouseCallback (MouseCallback callback) override |
| Set the mouse movement callback. | |
| void | setMouseButtonCallback (MouseButtonCallback callback) override |
| Set the mouse button callback. | |
| void | setScrollCallback (ScrollCallback callback) override |
| Set the scroll wheel callback. | |
| void | setCloseCallback (CloseCallback callback) override |
| Set the window close callback. | |
Public Member Functions inherited from undoStudio::services::WindowService | |
| virtual | ~WindowService ()=default |
Private Member Functions | |
| void | reportDisplaySetup () |
| Write the platform, the monitors and this window's scale to the log. | |
| void | setupCallbacks () |
| Setup all GLFW callbacks. | |
| void | setFileDropHandler (FileDropHandler handler) override |
Private Attributes | |
| GLFWwindow * | m_window = nullptr |
| ResizeCallback | m_resizeCallback |
| KeyCallback | m_keyCallback |
| MouseCallback | m_mouseCallback |
| MouseButtonCallback | m_mouseButtonCallback |
| ScrollCallback | m_scrollCallback |
| CloseCallback | m_closeCallback |
| FileDropHandler | m_fileDropHandler |
Additional Inherited Members | |
Public Types inherited from undoStudio::services::WindowService | |
| using | FileDropHandler = std::function< void(const std::vector< std::string > &)> |
| Be told which paths were dropped onto the window. | |
| using | ResizeCallback = std::function< void(int, int)> |
| using | KeyCallback = std::function< void(int, int, int, int)> |
| using | MouseCallback = std::function< void(double, double)> |
| using | MouseButtonCallback = std::function< void(int, int, int)> |
| using | ScrollCallback = std::function< void(double, double)> |
| using | CloseCallback = std::function< void()> |
Static Public Member Functions inherited from undoStudio::services::WindowService | |
| static WindowService & | getInstance () |
| Get the singleton instance of WindowService. | |
GLFW implementation of WindowService.
This class uses the GLFW library for window management and event handling. It provides OpenGL context creation and cross-platform window operations.
|
default |
|
overridedefault |
|
inlineoverridevirtual |
Get native GLFW window handle.
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Get current window size.
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Initialize GLFW and create a window.
| config | Window configuration |
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Poll and process all pending events.
Implements undoStudio::services::WindowService.
|
inlineprivate |
Write the platform, the monitors and this window's scale to the log.
The one line that decides whether two displays can be mixed is the window's content scale against the monitor's: the first is what the framebuffer is sized from and the second is what a popup on that monitor is sized from, and when they differ the popup is drawn for a density the window is not.
|
inlineoverridevirtual |
Set the window close callback.
| callback | Function to call on window close |
Implements undoStudio::services::WindowService.
|
inlineoverrideprivatevirtual |
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Set the keyboard input callback.
| callback | Function to call on keyboard events |
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Set the mouse button callback.
| callback | Function to call on mouse button events |
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Set the mouse movement callback.
| callback | Function to call on mouse movement |
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Set the window resize callback.
| callback | Function to call on window resize |
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Set the scroll wheel callback.
| callback | Function to call on scroll events |
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
|
inlineprivate |
Setup all GLFW callbacks.
This method registers all necessary GLFW callbacks and forwards them to the appropriate C++ callbacks.
|
inlineoverridevirtual |
Set window size.
| width | New window width |
| height | New window height |
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Check if window close event has been triggered.
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Shutdown GLFW and destroy the window.
Implements undoStudio::services::WindowService.
|
inlineoverridevirtual |
Swap the OpenGL front and back buffers.
Implements undoStudio::services::WindowService.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |