SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::core::Window Class Reference

An interface representing any window of any platform. More...

#include <Window.h>

Classes

struct  Settings
 A struct containing the settings used to create a window. More...
 

Public Member Functions

 Window (const Settings &settings)
 Creates a window with the given settings.
 
 Window (const Window &other)=delete
 
 Window (Window &&other) noexcept=default
 
Windowoperator= (const Window &other)=delete
 
Windowoperator= (Window &&other) noexcept=default
 
void close ()
 Closes the window.
 
void onUpdate ()
 Method called every frame to update the window.
 
bool isMinimized () const
 Checks if the window is minimized.
 
math::Vector2< unsigned int > size () const
 Gets the size of the window.
 
Renderer2D< render::vk::VulkanBackend > & renderer () const
 Gets the renderer of the window.
 
void * nativeWindow () const
 Gets a handle to the native platform window.
 

Public Attributes

spark::patterns::Signal< spark::math::Vector2< unsigned int > > onResize
 Event triggered when the window is resized.
 

Detailed Description

An interface representing any window of any platform.

Constructor & Destructor Documentation

◆ Window()

spark::core::Window::Window ( const Settings & settings)
explicit

Creates a window with the given settings.

Parameters
settingsThe Settings used to create and manage the window.

Member Function Documentation

◆ isMinimized()

bool spark::core::Window::isMinimized ( ) const

Checks if the window is minimized.

Returns
true if the window is minimized, false otherwise.

◆ nativeWindow()

void * spark::core::Window::nativeWindow ( ) const
nodiscard

Gets a handle to the native platform window.

Returns
A void* pointer to the native window which can be casted to the platform's window type.

◆ renderer()

Renderer2D< render::vk::VulkanBackend > & spark::core::Window::renderer ( ) const
nodiscard

Gets the renderer of the window.

Returns
A reference to the renderer of the window.

◆ size()

math::Vector2< unsigned int > spark::core::Window::size ( ) const
nodiscard

Gets the size of the window.

Returns
A 2D vector representing the width and height of the window.