XII Release 0.1.0
Loading...
Searching...
No Matches
xiiWindowCreationDescription Struct Reference

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

#include <Window.h>

Public Member Functions

xiiResult AdjustWindowSizeAndPosition ()
void SaveToDDL (xiiOpenDdlWriter &ref_writer)
 Serializes the configuration to DDL.
xiiResult SaveToDDL (xiiStringView sFile)
 Serializes the configuration to DDL.
void LoadFromDDL (const xiiOpenDdlReaderElement *pParentElement)
 Deserializes the configuration from DDL.
xiiResult LoadFromDDL (xiiStringView sFile)
 Deserializes the configuration from DDL.

Public Attributes

xiiString m_Title = "XII"
 The title of the window. This is just a hint and may be ignored by some platforms or window modes.
xiiEnum< xiiWindowMode > m_WindowMode
 The window mode determines how the position and resolution for the window are picked. For windowed modes, the position and resolution are taken from the corresponding members of this struct. For fullscreen modes, the position and resolution are taken from the monitor and the corresponding members of this struct are ignored (depending on the fullscreen mode).
xiiInt8 m_iMonitor = -1
 The monitor index is as given by xiiScreen::EnumerateScreens. -1 as the index means to pick the primary monitor. For windowed modes, this is just a hint which monitor to use for picking the default position. For fullscreen modes, this is the monitor on which the window will appear and from which the position and resolution are taken (depending on m_WindowMode).
xiiVec2I32 m_Position = xiiVec2I32(0x80000000, 0x80000000)
 The default position is a special value that means "let the OS decide". The user can change this to a specific position, which will be used for windowed modes. For fullscreen modes, the position is taken from the monitor and this value is ignored.
xiiSizeU32 m_Resolution = xiiSizeU32(1280U, 720U)
 The resolution of the window. For windowed modes, this is the resolution of the client area. For fullscreen modes, this is the requested resolution, which may be different from the actual resolution if the monitor does not support it.
xiiUInt8 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.
bool m_bClipMouseCursor = true
 Whether the mouse cursor should be trapped inside the window or not. This is only relevant for windowed modes and is ignored for fullscreen modes, which always clip the mouse cursor.
bool m_bShowMouseCursor = false
 Whether the mouse cursor should be visible or not.
bool m_bSetForegroundOnInit = true
 If true, the window will be activated and focused when it is initialized. This is ignored for fullscreen modes, which are always activated and focused.
bool m_bCenterWindowOnDisplay = true
 If true, the window will be centered on the display. This is only relevant for windowed modes and is ignored for fullscreen modes.

Detailed Description

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

Member Function Documentation

◆ AdjustWindowSizeAndPosition()

xiiResult xiiWindowCreationDescription::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 xiiScreen::EnumerateScreens fails to enumerate the available screens.


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