engine::Window class

Manages the application window and its associated context.

This class is a wrapper around the underlying GLFW windowing library.

Constructors, destructors, conversion operators

Window(int width, int height, std::string name)
Constructs a new Window with the specified dimensions and title.

Public functions

auto native_handle() const -> GLFWwindow*
Returns a pointer to the native GLFW window handle.
auto IsRunning() const -> bool
Checks if the window should remain open.
auto ShouldClose() const -> bool
Checks if the window should close.
void SwapBuffers() const
Swaps the front and back buffers.
void PollEvents()
Processes all pending events, such as keyboard and mouse input.
auto delta_time() const -> double
Calculates and returns the time elapsed since the last frame.
auto width() const -> int
Gets the width of the window.
auto height() const -> int
Gets the height of the window.

Function documentation

engine::Window::Window(int width, int height, std::string name)

Constructs a new Window with the specified dimensions and title.

Parameters
width The width of the window in pixels.
height The height of the window in pixels.
name The title of the window.

GLFWwindow* engine::Window::native_handle() const

Returns a pointer to the native GLFW window handle.

Returns Pointer to the GLFWwindow.

bool engine::Window::IsRunning() const

Checks if the window should remain open.

Returns true if the window should stay open, false otherwise.

bool engine::Window::ShouldClose() const

Checks if the window should close.

Returns true if the window should close, false otherwise.

double engine::Window::delta_time() const

Calculates and returns the time elapsed since the last frame.

Returns The delta time in seconds.

int engine::Window::width() const

Gets the width of the window.

Returns Width in pixels.

int engine::Window::height() const

Gets the height of the window.

Returns Height in pixels.