Class Window

Inheritance Relationships

Base Type

  • public EventHandler

Derived Type

Class Documentation

class Window : public EventHandler

Subclassed by portal::GlfwWindow

Public Functions

Window(const WindowProperties &properties, const CallbackConsumers &consumers)

Constructs a Window

Parameters:

properties – The preferred configuration of the window

virtual void process_events() = 0

Handles the processing of all underlying window events

virtual bool should_close() const = 0

Checks if the window should be closed

virtual void close() = 0

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

WindowExtent resize(const WindowExtent &requested_extent)

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 Reference<renderer::Surface> create_surface(const renderer::vulkan::VulkanContext &context) = 0

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 float get_dpi_factor() const = 0
Returns:

The dot-per-inch scale factor

virtual float get_content_scale_factor() const
Returns:

The scale factor for systems with heterogeneous window and pixel coordinates

virtual void maximize() = 0
virtual void center_window() = 0
virtual void set_vsync(bool enable) = 0
virtual void set_resizeable(bool enable) = 0
virtual void set_title(StringId title) = 0
virtual glm::vec2 get_position() const = 0
inline size_t get_width() const
inline size_t get_height() const
inline WindowExtent get_extent() const
inline StringId get_title() const
inline bool is_resizeable() const
inline WindowMode get_mode() const
inline bool is_vsynced() const
inline const WindowProperties &get_properties() const

Protected Attributes

WindowProperties properties
CallbackConsumers consumers