class HeadlessRenderWindow

Inherits: RenderWindow

A headless render window that doesn't create an OS window.

Used for headless rendering in automated testing or offscreen rendering scenarios. All window-handle-dependent operations become no-ops.

Public

Constructors

HeadlessRenderWindow

HeadlessRenderWindow(const RenderWindowCreateInformation &createInformation, u32 windowId, const SPtr<RenderWindow> &parentWindow)

Methods

Initialize

void Initialize() override

Initializes all the internal data of this object.

Must be called right after construction for new objects, or after deserialization for deserialized objects. If requested, render proxy is created and queued for initialization on the render thread.

Destroy

void Destroy() override

Closes and destroys the window.

ScreenToWindowPosition

Vector2I ScreenToWindowPosition(const Vector2I &screenPosition) const override

Converts screen position into window local position.

WindowToScreenPosition

Vector2I WindowToScreenPosition(const Vector2I &windowPosition) const override

Converts window local position to screen position.

Resize

void Resize(u32 width, u32 height) override

Resize the window to specified width and height in pixels.

width
Width of the window in pixels.
height
Height of the window in pixels.

Move

void Move(i32 left, i32 top) override

Move the window to specified screen coordinates.

left
Position of the left border of the window on the screen.
top
Position of the top border of the window on the screen.

Hide

void Hide() override

Hides the window.

Show

void Show() override

Shows a previously hidden window.

Minimize

void Minimize() override

Minimizes the window to the taskbar.

Maximize

void Maximize() override

Maximizes the window over the entire current screen.

Restore

void Restore() override

Restores the window to original position and size if it is minimized or maximized.

SetFullscreen

void SetFullscreen(u32 width, u32 height, float refreshRate = 60.F, u32 monitorIndex = 0) override

Switches the window to fullscreen mode.

Child windows cannot go into fullscreen mode.

width
Width of the window frame buffer in pixels.
height
Height of the window frame buffer in pixels.
refreshRate
Refresh rate of the window in Hertz.
monitorIndex
Index of the monitor to go fullscreen on.

SetWindowed

void SetWindowed(u32 width, u32 height) override

Switches the window to windowed mode.

width
Window width in pixels.
height
Window height in pixels.

SetVSync

void SetVSync(bool enabled, u32 interval = 1) override

Enables or disables vertical synchronization.

When enabled the system will wait for monitor refresh before presenting the back buffer. This eliminates tearing but can result in increased input lag.

enabled
True to enable vsync, false to disable.
interval
Interval at which to perform the sync. Value of one means the sync will be performed for each monitor refresh, value of two means it will be performs for every second (half the rate), and so on.

GetPlatformWindowHandle

u64 GetPlatformWindowHandle() const override

Returns 0 since there is no platform window.

Protected

Methods

CreateRenderProxy

SPtr<render::RenderProxy> CreateRenderProxy() const override

Creates an object that contains render thread specific data and methods for this object.

Can be null if such object is not required.