Class GlfwWindow

Inheritance Relationships

Base Type

Class Documentation

class GlfwWindow : public portal::Window

Public Functions

GlfwWindow(ProjectSettings &settings, const WindowProperties &properties, entt::dispatcher &dispatcher)
~GlfwWindow() override
virtual Reference<renderer::Surface> create_surface(const renderer::vulkan::VulkanContext &context) override

Creates a surface inside a gpu context and returns it NOTE: The window is not the owner of the surface and is not responsible for cleaning it before destruction.

Parameters:

context – The GPU Context to create the surface in TODO: rename VulkanContext to GpuContext

Returns:

An owning reference to the Surface created

virtual void process_events() override

Handles the processing of all underlying window events

virtual bool should_close() const override

Checks if the window should be closed

virtual void close() override

Request a close to the window. NOTE: this will trigger a corresponding window event

virtual float get_dpi_factor() const override

It calculates the dpi factor using the density from GLFW physical size GLFW docs for dpi

virtual void maximize() override
virtual void restore() override
virtual void minimize() override
virtual void center_window() override
virtual WindowExtent resize(const WindowExtent &requested_extent) override

Attempts to resize the window to the requested extent - not guaranteed to change

Parameters:

requested_extent – The preferred window extent.

Returns:

The new window extent, based on window limitation and mode

virtual void set_vsync(bool enable) override
virtual void set_resizeable(bool enable) override
virtual void set_title(StringId title) override
virtual glm::vec2 get_position() const override
GLFWwindow *get_handle() const
virtual bool is_maximised() const override
virtual bool is_minimized() const override

Protected Functions

void change_mouse_mode(SetMouseCursorEvent event) const
void window_drag(WindowDragEvent event)
void maximize_or_restore()
void request_minimize()
void request_close()
void inner_update_maximized(WindowUpdateMaximizedEvent event)