GLFWApplication.ixx File
GLFW-specific Application implementation. More...
Included Headers
#include <glad/gl.h>
#include <glfw/glfw3.h>
#include <memory>
#include <vector>
#include <stdexcept>
#include <format>
#include <helios.ext.glfw.app.GLFWRAIIGuard>
#include <helios.rendering.RenderTarget>
#include <helios.event.EventManager>
#include <helios.ext.glfw.window.GLFWWindow>
#include <helios.rendering.RenderingDevice>
#include <helios.ext.glfw.window.GLFWWindowConfig>
#include <helios.input.InputManager>
#include <helios.window.Window>
#include <helios.window.WindowConfig>
#include <helios.app.Application>
Namespaces Index
| namespace | helios |
| namespace | ext |
|
Platform-specific extensions and backend implementations. More... | |
| namespace | glfw |
|
GLFW-specific implementations. More... | |
| namespace | app |
|
GLFW application infrastructure. More... | |
Classes Index
| class | GLFWApplication |
|
An Application implementation for glfw-based environments. More... | |
Description
GLFW-specific Application implementation.
File Listing
The file content with the documentation metadata removed is:
29export namespace helios::ext::glfw::app {
36 class GLFWApplication : public helios::app::Application {
43 helios::window::Window* current_ = nullptr;
48 GLFWRAIIGuard glfwRaiiGuard_;
58 explicit GLFWApplication(
59 std::unique_ptr<helios::rendering::RenderingDevice> renderingDevice,
60 std::unique_ptr<helios::input::InputManager> inputManager,
61 std::unique_ptr<helios::event::EventManager> eventManager)
62 : Application(
63 std::move(renderingDevice),
64 std::move(inputManager),
65 std::move(eventManager)),
100 const helios::ext::glfw::window::GLFWWindowConfig& cfg
102 auto window = std::make_unique<helios::ext::glfw::window::GLFWWindow>(std::move(renderTarget), cfg);
104 if (const auto glfw_window = window.get()) {
107 logger_.error(msg);
113 if (!renderingDevice_->initialized()) {
115 renderingDevice_->init();
128 windowList_.emplace_back(std::move(window));
130 return *dynamic_cast<helios::ext::glfw::window::GLFWWindow*>(windowList_.back().get());
139 const helios::window::WindowConfig& cfg
141 auto const* tmp_cfg = dynamic_cast<helios::ext::glfw::window::GLFWWindowConfig const*>(&cfg);
144 logger_.error(msg);
148 return createWindow(std::move(renderTarget), *tmp_cfg);
161 * @throws std::invalid_argument If `win` is not a `GLFWWindow` or not owned by this application.
163 void setCurrent(helios::window::Window& win) override {
164 if (!hasWindow(win)) {
166 logger_.error(msg);
170 if (const auto glfw_window = dynamic_cast<helios::ext::glfw::window::GLFWWindow*>(&win)) {
184 logger_.error(msg);
188 inputManager_->observe(win);
195 [[nodiscard]] helios::window::Window* current() const noexcept override {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.