XII Release 0.1.0
Loading...
Searching...
No Matches
xiiWindowManager Class Referencefinal

#include <WindowManager.h>

Public Member Functions

void Update ()
xiiRegisteredWindowHandle Register (xiiStringView sName, const void *pCreatedBy, xiiUniquePtr< xiiWindowBase > &&pWindow)
void GetRegistered (xiiDynamicArray< xiiRegisteredWindowHandle > &out_windowHandles, const void *pCreatedBy=nullptr)
bool IsValid (xiiRegisteredWindowHandle hWindow) const
xiiStringView GetName (xiiRegisteredWindowHandle hWindow) const
 Gets the name of a registered window.
xiiWindowBase * GetWindow (xiiRegisteredWindowHandle hWindow) const
 Gets the window implementation for a registered window.
void SetDestroyCallback (xiiRegisteredWindowHandle hWindow, xiiWindowDestroyFunc onDestroyCallback)
void Close (xiiRegisteredWindowHandle hWindow)
void CloseAll (const void *pCreatedBy)

Detailed Description

Manages registered windows and their associated data.

The WindowManager provides a centralized system for managing windows throughout their lifetime. Windows are registered with unique handles and can have associated output targets and destruction callbacks.

Member Function Documentation

◆ Close()

void xiiWindowManager::Close ( xiiRegisteredWindowHandle hWindow)

Closes and unregisters a specific window.

This first calls any registered destroy callback, then destroys the output target, then the window. The handle becomes invalid after this call.

◆ CloseAll()

void xiiWindowManager::CloseAll ( const void * pCreatedBy)

Closes all windows created by a specific object.

Parameters
pCreatedByIdentifier of the creator, or nullptr to close all windows

This is useful for cleanup when an object that created multiple windows is destroyed.

◆ GetRegistered()

void xiiWindowManager::GetRegistered ( xiiDynamicArray< xiiRegisteredWindowHandle > & out_windowHandles,
const void * pCreatedBy = nullptr )

Retrieves handles for all registered windows.

Parameters
out_WindowIDsArray to fill with window handles.
pCreatedByOptional filter to only return windows created by this object.

◆ IsValid()

bool xiiWindowManager::IsValid ( xiiRegisteredWindowHandle hWindow) const

Checks if a window handle is valid and refers to an existing window.

Invalid handles can occur if the window was closed or if using a default-constructed handle.

◆ Register()

xiiRegisteredWindowHandle xiiWindowManager::Register ( xiiStringView sName,
const void * pCreatedBy,
xiiUniquePtr< xiiWindowBase > && pWindow )

Registers a new window with the manager.

Parameters
sNameHuman-readable name for the window (for debugging).
pCreatedByPointer identifying the creator (used for bulk operations).
pWindowThe window implementation to register.
Returns
Handle to the registered window.

The returned handle remains valid until the window is explicitly closed. The pCreatedBy parameter allows closing all windows created by a specific object.

◆ SetDestroyCallback()

void xiiWindowManager::SetDestroyCallback ( xiiRegisteredWindowHandle hWindow,
xiiWindowDestroyFunc onDestroyCallback )

Sets a callback to be invoked when the window is destroyed.

The callback receives the window handle as parameter. Only one callback can be set per window, setting a new callback replaces the previous one.

◆ Update()

void xiiWindowManager::Update ( )

Processes window messages for all registered windows.

This should be called regularly (typically once per frame) to handle platform-specific window events.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/Core/System/WindowManager.h
  • /home/runner/work/XII/XII/Source/Engine/Core/System/Implementation/WindowManager.cpp