Core::Display::Window

Window Management in Unified Engine

Within the Unified Engine, we have structures and classes to help you easily create and manage windows. This documentation provides an overview of the Window class and the WindowConfig structure.

WindowConfig Structure

The WindowConfig structure is designed to contain all necessary configurations for creating a window.

Configuration Options

  • Sizing: Determine the starting position of the window on the screen.

uint32_t x = 0;
uint32_t y = 0;
  • Resolution: Specify the window's width and height.

char* title = nullptr;
  • Window Settings: A collection of window settings, including:

    • Resizability

    • Full-screen mode

    • V-Sync

    • FPS limit

    • Default background color

    • GLFW monitor for multi-display setups

bool resizable = false;
bool fullScreen = false;
bool vsync = false;
int fps = -1;
Color backgroundColor = {0.0f, 0.0f, 0.0f, 0.0f};
GLFWmonitor* monitor = NULL;
  • Multi-window Setup: For sharing OpenGL contexts between windows.

GLFWwindow* sharedContext = NULL;

Window Class

The Window class extends from the GameInteractionObject and is responsible for managing window lifecycle, updates, and configurations.

Methods & Functions

  • Constructor & Destructor: Initialize or destroy a window with a specified configuration.

Window(WindowConfig config);
~Window();
  • Activator: Activate the window, get its context or its configurations.

int Activate();
inline GLFWwindow* Context();
inline WindowConfig Config();
  • Configurators: Load a window configuration.

int LoadWindowConfig(WindowConfig Config);

Lifecycle Management

  • Loading & Unloading: Overridden methods from GameInteractionObject to manage window lifecycle.

int Load() override;
int Unload() override;
  • Update Window: Update the window's properties and settings.

void UpdateWindow();

Last updated