ezEngine  Release 25.03
ezWindowCreationDesc Struct Reference

Parameters for creating a window, such as position and resolution. More...

#include <Window.h>

Public Member Functions

ezResult AdjustWindowSizeAndPosition ()
 Adjusts the position and size members, depending on the current value of m_WindowMode and m_iMonitor. More...
 
void SaveToDDL (ezOpenDdlWriter &ref_writer)
 Serializes the configuration to DDL.
 
ezResult SaveToDDL (ezStringView sFile)
 Serializes the configuration to DDL.
 
void LoadFromDDL (const ezOpenDdlReaderElement *pParentElement)
 Deserializes the configuration from DDL.
 
ezResult LoadFromDDL (ezStringView sFile)
 Deserializes the configuration from DDL.
 

Public Attributes

ezString m_Title = "ezEngine"
 The window title to be displayed.
 
ezEnum< ezWindowModem_WindowMode
 Defines how the window size is determined.
 
ezInt8 m_iMonitor = -1
 
ezVec2I32 m_Position = ezVec2I32(0x80000000, 0x80000000)
 The virtual position of the window. Determines on which monitor the window ends up.
 
ezSizeU32 m_Resolution = ezSizeU32(1280, 720)
 The pixel resolution of the window.
 
ezUInt8 m_uiWindowNumber = 0
 
bool m_bClipMouseCursor = true
 
bool m_bShowMouseCursor = false
 
bool m_bSetForegroundOnInit = true
 Whether the window is activated and focussed on Initialize()
 
bool m_bCenterWindowOnDisplay = true
 Whether the window is centered on the display.
 

Detailed Description

Parameters for creating a window, such as position and resolution.

Member Function Documentation

◆ AdjustWindowSizeAndPosition()

ezResult ezWindowCreationDesc::AdjustWindowSizeAndPosition ( )

Adjusts the position and size members, depending on the current value of m_WindowMode and m_iMonitor.

For windowed mode, this does nothing. For fullscreen modes, the window position is taken from the given monitor. For borderless fullscreen mode, the window resolution is also taken from the given monitor.

This function can only fail if ezScreen::EnumerateScreens fails to enumerate the available screens.

Member Data Documentation

◆ m_bClipMouseCursor

bool ezWindowCreationDesc::m_bClipMouseCursor = true

Whether the mouse cursor should be trapped inside the window or not.

See also
ezStandardInputDevice::SetClipMouseCursor

◆ m_bShowMouseCursor

bool ezWindowCreationDesc::m_bShowMouseCursor = false

Whether the mouse cursor should be visible or not.

See also
ezStandardInputDevice::SetShowMouseCursor

◆ m_iMonitor

ezInt8 ezWindowCreationDesc::m_iMonitor = -1

The monitor index is as given by ezScreen::EnumerateScreens. -1 as the index means to pick the primary monitor.

◆ m_uiWindowNumber

ezUInt8 ezWindowCreationDesc::m_uiWindowNumber = 0

The number of the window. This is mostly used for setting up the input system, which then reports different mouse positions for each window.


The documentation for this struct was generated from the following files: