GLFWApplication Class
An Application implementation for glfw-based environments. More...
Declaration
Base class
| class | helios::app::Application |
Public Constructors Index
| GLFWApplication (std::unique_ptr< helios::rendering::RenderingDevice > renderingDevice, std::unique_ptr< helios::input::InputManager > inputManager, std::unique_ptr< helios::event::EventManager > eventManager) | |
|
Constructs a new `GLFWApplication` instance. More... | |
Public Member Functions Index
| void | init () override |
| helios::ext::glfw::window::GLFWWindow & | createWindow (std::unique_ptr< helios::rendering::RenderTarget > renderTarget, const helios::ext::glfw::window::GLFWWindowConfig &cfg) |
|
Creates a new GLFWWindow and add it to this Application's windows collection. The Application takes ownership of the window. More... | |
| helios::ext::glfw::window::GLFWWindow & | createWindow (std::unique_ptr< helios::rendering::RenderTarget > renderTarget, const helios::window::WindowConfig &cfg) override |
| void | setCurrent (helios::window::Window &win) override |
|
Sets the current window for this application. More... | |
| helios::window::Window * | current () const noexcept override |
Private Member Attributes Index
| helios::window::Window * | current_ = nullptr |
|
A pointer to the currently active window of the Application, or `nullptr` if there is no currently active window. More... | |
| GLFWRAIIGuard | glfwRaiiGuard_ |
|
RAII Guard for glfw initialization and termination. More... | |
Description
An Application implementation for glfw-based environments.
This application owns a `GLFWRAIIGuard`.
Definition at line 36 of file GLFWApplication.ixx.
Public Constructors
GLFWApplication()
| inline explicit |
Constructs a new `GLFWApplication` instance.
- Parameters
-
renderingDevice Unique rendering device owned by the application.
inputManager Unique input manager instance.
eventManager Unique event manager instance.
Definition at line 58 of file GLFWApplication.ixx.
Public Member Functions
createWindow()
| inline |
Creates a new GLFWWindow and add it to this Application's windows collection. The Application takes ownership of the window.
Delegates to Window::show() for showing the window and initializes the associated rendering device if necessary, e.g. for glfw an additional `glfwMakeContextCurrent()` is called so the rendering device can be safely initialized, then immediately passes a `nullptr` to the `glfwMakeContextCurrent()` to force calling APIs to explicitly call setCurrent() on the constructed window. The render target size is synced to the current framebuffer dimensions reported by `glfwGetFramebufferSize()`.
- Returns
Reference to the created window instance.
- Returns
A ref to the window created.
Definition at line 98 of file GLFWApplication.ixx.
Referenced by createWindow.
createWindow()
| inline |
Definition at line 137 of file GLFWApplication.ixx.
Reference createWindow.
current()
| inline nodiscard noexcept |
Definition at line 195 of file GLFWApplication.ixx.
init()
| inline |
Definition at line 72 of file GLFWApplication.ixx.
setCurrent()
| inline |
Sets the current window for this application.
Ensures `glfwMakeContextCurrent()` is called to bind the correct context for subsequent glfw operations and re-registers the framebuffer size callback on the targeted window.
- Parameters
-
win Reference to the window that becomes the current context owner.
- Exceptions
-
std::invalid_argument If `win` is not a `GLFWWindow` or not owned by this application.
Definition at line 163 of file GLFWApplication.ixx.
Private Member Attributes
current_
|
A pointer to the currently active window of the Application, or `nullptr` if there is no currently active window.
Definition at line 43 of file GLFWApplication.ixx.
glfwRaiiGuard_
|
RAII Guard for glfw initialization and termination.
Definition at line 48 of file GLFWApplication.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.