![]() |
XII Release 0.1.0
|
A simple abstraction for platform specific window creation. More...
#include <Window.h>
Public Member Functions | |
xiiWindow () | |
Creates empty window instance with standard settings. | |
virtual | ~xiiWindow () |
Destroys the window if not already done. | |
const xiiWindowCreationDescription & | GetCreationDescription () const |
Returns the currently active description struct. | |
virtual xiiSizeU32 | GetClientAreaSize () const override |
Returns the size of the client area / ie. the window resolution. | |
virtual xiiWindowHandle | GetNativeWindowHandle () const override |
Returns the platform specific window handle. | |
virtual bool | IsFullscreenWindow (bool bOnlyProperFullscreenMode=false) const override |
Returns whether the window covers an entire monitor. | |
virtual bool | IsVisible () const override |
Whether the window can potentially be seen by the user. Windows that are minimized or hidden are not visible. | |
virtual void | AddReference () override |
virtual void | RemoveReference () override |
virtual void | ProcessWindowMessages () override |
Runs the platform specific message pump. | |
xiiResult | Initialize () |
Creates a new platform specific window with the current settings. | |
xiiResult | Initialize (const xiiWindowCreationDescription &creationDescription) |
Creates a new platform specific window with the given settings. | |
bool | IsInitialized () const |
Gets if the window is up and running. | |
xiiResult | Destroy () |
Destroys the window. | |
xiiResult | Resize (const xiiSizeU32 &newWindowSize) |
Tries to resize the window. Override OnResize to get the actual new window size. | |
virtual void | OnResize (const xiiSizeU32 &newWindowSize) |
Called on window resize messages. | |
virtual void | OnWindowMove (const xiiInt32 iNewPosX, const xiiInt32 iNewPosY) |
Called when the window position is changed. Not possible on all OSes. | |
virtual void | OnFocus (bool bHasFocus) |
Called when the window gets focus or loses focus. | |
virtual void | OnVisibleChange (bool bVisible) |
Called when the window gets focus or loses focus. | |
virtual void | OnClickClose () |
Called when the close button of the window is clicked. Does nothing by default. | |
xiiStandardInputDevice * | GetInputDevice () const |
Returns the input device that is attached to this window and typically provides mouse / keyboard input. | |
Static Public Member Functions | |
static xiiUInt8 | GetNextUnusedWindowNumber () |
Returns a number that can be used as a window number in xiiWindowCreationDescription. | |
Protected Attributes | |
xiiWindowCreationDescription | m_CreationDescription |
A simple abstraction for platform specific window creation.
Will handle basic message looping. Notable events can be listened to by overriding the corresponding callbacks. You should call ProcessWindowMessages every frame to keep the window responsive. Input messages will not be forwarded automatically. You can do so by overriding the OnWindowMessage function.
xiiWindow::xiiWindow | ( | ) |
Creates empty window instance with standard settings.
You need to call Initialize to actually create a window.
|
inlineoverridevirtual |
Implements xiiWindowBase.
|
inlineoverridevirtual |
Returns the size of the client area / ie. the window resolution.
Implements xiiWindowBase.
|
overridevirtual |
Returns the platform specific window handle.
Implements xiiWindowBase.
|
static |
Returns a number that can be used as a window number in xiiWindowCreationDescription.
This number just increments whenever a xiiWindow is created. It starts at zero.
xiiResult xiiWindow::Initialize | ( | ) |
Creates a new platform specific window with the current settings.
Will automatically call xiiWindow::Destroy if window is already initialized.
|
inline |
Creates a new platform specific window with the given settings.
Will automatically call xiiWindow::Destroy if window is already initialized.
creationDescription | Struct with various settings for window creation. Will be saved internally for later lookup. |
|
inlineoverridevirtual |
Returns whether the window covers an entire monitor.
If bOnlyProperFullscreenMode == false, this includes borderless windows.
Implements xiiWindowBase.
|
inlineoverridevirtual |
Whether the window can potentially be seen by the user. Windows that are minimized or hidden are not visible.
Implements xiiWindowBase.
|
inlinevirtual |
Called when the close button of the window is clicked. Does nothing by default.
Reimplemented in xiiGameStateWindow.
|
virtual |
Called on window resize messages.
newWindowSize | New window size in pixel. |
Reimplemented in xiiGameStateWindow.
|
overridevirtual |
Runs the platform specific message pump.
You should call ProcessWindowMessages every frame to keep the window responsive.
Implements xiiWindowBase.
|
inlineoverridevirtual |
Implements xiiWindowBase.
|
protected |
Description at creation time. xiiWindow will not update this in any method other than Initialize.