PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
Loading...
Searching...
No Matches
PureWindowImpl Class Reference

Detailed Description

Definition at line 33 of file PureWindow.cpp.

+ Inheritance diagram for PureWindowImpl:

Public Member Functions

virtual ~PureWindowImpl ()
 
CConsole & getConsole () const
 Returns access to console preset with logger module name as this class.
 
TPureBool initialize (TPureUInt width, TPureUInt height, TPureBool bFullscreen, const char *caption, HWND window=NULL)
 This creates the window actually.
 
void Deinitialize ()
 This deletes the window, then initialize() can be called again later.
 
TPureBool isInitialized () const
 Gets whether the window is initialized.
 
void ResetDefaults ()
 Resets the default settings.
 
TPureUInt getWidth () const
 Gets window width.
 
void SetWidth (TPureUInt newwidth)
 Sets window width.
 
TPureUInt getClientWidth () const
 Gets window client width.
 
void SetClientWidth (TPureUInt newwidth)
 Sets window client width.
 
TPureUInt getHeight () const
 Gets window height.
 
void SetHeight (TPureUInt newheight)
 Sets window height.
 
TPureUInt getClientHeight () const
 Gets window client height.
 
void SetClientHeight (TPureUInt newheight)
 Sets window client width.
 
TPureUInt getSideFrameWidth () const
 Gets window side frame width.
 
TPureUInt getBottomFrameHeight () const
 Gets window bottom frame height.
 
TPureUInt getCaptionHeight () const
 Gets window caption area height.
 
TPureUInt getTitleBarHeight () const
 Gets window title bar height.
 
TPureUInt getX () const
 Gets window X-coordinate.
 
void SetX (TPureUInt newx)
 Sets window X-coordinate.
 
TPureUInt getY () const
 Gets window Y-coordinate.
 
void SetY (TPureUInt newy)
 Sets window Y-coordinate.
 
HWND getWndHandle () const
 Gets window handle.
 
HDC getWndDC () const
 Gets window Device Context.
 
TPureBool isActive () const
 Gets whether window is active or not.
 
void SetActive ()
 Sets the window active.
 
TPureBool isTopMost () const
 Gets whether window is topmost or not.
 
void SetTopMost (TPureBool state)
 Sets the window topmost property.
 
const std::string & getCaption () const
 Gets the window caption.
 
void SetCaption (const std::string &newcaption)
 Sets the window caption.
 
TPureBool isResizableH () const
 Gets whether window is resizable horizontally.
 
void SetResizableH (TPureBool state)
 Sets whether window is resizable horizontally.
 
TPureBool isResizableV () const
 Gets whether window is resizable vertically.
 
void SetResizableV (TPureBool state)
 Sets whether window is resizable vertically.
 
TPureBool isResizable () const
 Gets whether window is fully resizable.
 
void SetResizable (TPureBool state)
 Sets whether window is fully resizable.
 
TPureBool hasBorder () const
 Gets whether window has border or not.
 
void SetBorder (TPureBool state)
 Sets whether window has border or not.
 
TPureBool hasSysMenu () const
 Gets whether window has sysmenu or not.
 
void SetSysMenu (TPureBool state)
 Sets whether window has sysmenu or not.
 
TPureBool hasMinButton () const
 Gets whether window has minimize button or not.
 
void SetMinButton (TPureBool state)
 Sets whether window has minimize button or not.
 
TPureBool hasMaxButton () const
 Gets whether window has maximize/restore button or not.
 
void SetMaxButton (TPureBool state)
 Sets whether window has maximize/restore button or not.
 
TPureBool isEnabled () const
 Gets whether window is enabled or not.
 
void SetEnabled (TPureBool state)
 Sets whether window is enabled or not.
 
WNDPROC getWindowProc () const
 Gets the message handling window procedure of this window.
 
void SetWindowProc (const WNDPROC windowproc)
 Sets the message handling window procedure of this window.
 
void ProcessMessages ()
 Processes the queued window messages.
 
TPureBool hasCloseRequest () const
 Gets whether the window has a close request or not.
 
TPureBool isAutoRedrawAllOnPosChange () const
 Gets whether automatic redraw of window contents on position change is enabled or not.
 
void SetAutoRedrawAllOnPosChange (TPureBool state)
 Sets whether automatic redraw of window contents on position change is enabled or not.
 
TPureBool isAutoCleanupOnQuitOn () const
 Gets whether automatic cleanup of window on close request is enabled or not.
 
void SetAutoCleanupOnQuitOn (TPureBool state)
 Sets whether automatic cleanup of window on close request is enabled or not.
 
TPureBool getAutoCameraWarningState () const
 Gets whether automatic camera warning on resize is enabled or not.
 
void SetAutoCameraWarningState (TPureBool state)
 Sets whether automatic camera warning on resize is enabled or not.
 
void Show ()
 Shows the window.
 
void ShowFull ()
 Shows and brings the window to front and sets the focus to it.
 
void Hide ()
 Hides the window.
 
void Minimize ()
 Minimizes the window, so it will be visible only on the Taskbar.
 
void Maximize ()
 Maximizes the window.
 
void Restore ()
 Restores the window to the previous state Equivalent to clicking the restore button in the sysmenu.
 
void Close ()
 Closes the window.
 
TPureBool isCursorVisible () const
 Gets whether the mouse cursor is visible or not within the window area.
 
void SetCursorVisible (TPureBool state)
 Sets whether the mouse cursor is visible or not within the window area.
 
void WriteSettings ()
 Writes the window properties to the console window.
 
- Public Member Functions inherited from PureWindow

Static Public Member Functions

static const char * getLoggerModuleName ()
 Returns the logger module name of this class.
 
- Static Public Member Functions inherited from PureWindow
static PureWindowcreateAndGet (PGEcfgProfiles &cfgProfiles, PGEInputHandler &inputHandler)
 Creates and gets the singleton instance.
 

Private Member Functions

 PureWindowImpl (PGEcfgProfiles &cfgProfiles, PGEInputHandler &inputHandler)
 
 PureWindowImpl (const PureWindowImpl &)
 
PureWindowImploperator= (const PureWindowImpl &)
 
void SetPropertiesBeforeInitialize ()
 Sets default values to properties, used by ctor and Deinitialize().
 
TPureBool setupWindowClass (WNDCLASS &clWnd)
 Fills the given WNDCLASS structure and registers it.
 
TPureBool actualCreateWindow (TPureUInt width, TPureUInt height, TPureBool bFullscreen, const char *caption, const WNDCLASS &clWnd)
 This creates the window actually.
 
LRESULT onActivate (TPureBool isActive)
 
LRESULT onSysCommand (WPARAM wParam, LPARAM lParam)
 
LRESULT onClose ()
 
LRESULT onDestroy ()
 
LRESULT onInput (HRAWINPUT handle)
 
LRESULT onKeyUp (TPureInt key)
 
LRESULT onKeyDown (TPureInt key)
 
LRESULT onMouseMove (TPureInt x, TPureInt y)
 
LRESULT onMouseWheel (TPureShort nWheel)
 
LRESULT onMouseUp (PGEInputMouse::MouseButton btn, WPARAM wParam, TPureInt x, TPureInt y)
 
LRESULT onMouseDown (PGEInputMouse::MouseButton btn, WPARAM wParam, TPureInt x, TPureInt y)
 
LRESULT onRedrawRequired ()
 
LRESULT onPosChanged (const LPWINDOWPOS newPos)
 

Private Attributes

const PureSharedSettingssharedSettings
 Pointer to shared settings, const because we just reading it.
 
PGEcfgProfiles & m_cfgProfiles
 
PGEInputHandler & input
 Our source of input.
 
RAWINPUT rawInput
 For raw mouse input.
 
UINT rawInputSize
 Size of RAWINPUT.
 
HWND hWindow
 Window Handle.
 
TPureBool bExternalOwner
 If true, then an existing window was specified at init, thus we neither create nor delete the window.
 
DWORD dwStyle
 
DWORD dwStyleEx
 Window styles.
 
WNDCLASS clWindow
 Window class.
 
TITLEBARINFOEX infoTitlebar
 Extended title bar info, for Vista and newer.
 
RECT rectWindowFull
 Position and full size of the window.
 
RECT rectWindowClient
 Position and size of window client area.
 
TPureUInt nClientWidthOrig
 Original width of the window's client area.
 
TPureUInt nClientHeightOrig
 Original height of the window's client area.
 
TPureUInt nSideFrameWidth
 Side frame width.
 
TPureUInt nBottomFrameHeight
 Bottom frame height.
 
TPureUInt nCaptionHeight
 Caption area height.
 
TPureUInt nTitleBarHeight
 Title bar height.
 
TPureBool m_bFullscreen
 Is it a fullscreen window or not.
 
std::string sCaption
 Window title.
 
TPureBool enabled
 Is the window enabled or not.
 
TPureBool bVisibleCursor
 Is the mouse cursor visible or not.
 
TPureBool bBtnMin
 Does the window have a minimize button or not.
 
TPureBool bBtnMax
 Does the window have a maximize button or not.
 
TPureBool bBorder
 Does the window have border or not.
 
TPureBool bSysMenu
 Does the window have a sysmenu or not.
 
TPureBool bResizingH
 Is horizontal resizing enabled or not.
 
TPureBool bResizingV
 Is vertical resizing enabled or not.
 
TPureBool bCloseRequested
 True if a close request has been captured by the window.
 
TPureBool bActive
 Is the window active or not.
 
TPureBool bTopMost
 Is the window topmost or not.
 
TPureBool bAutoCleanupOnQuit
 If true, the window will close itself on close request.
 
TPureBool bAutoCameraWarn
 If true, the window will notify cameras about resizing.
 
TPureBool bAutoRedrawOnPosChange
 If true, the window will redraw its content on position change.
 

Static Private Attributes

static const TPureBool DEF_AUTOCLEANUP = true
 Default value of automatic cleanup on close request.
 
static const TPureBool DEF_AUTOCAMWARN = true
 Default value of automatic camera warning on resizing.
 
static const TPureBool DEF_REDRAWALL_WNDPOSCHNG = true
 Default value of automatic redrawing of window content on position change.
 

Friends

class PureWindow
 
LRESULT __stdcall PuredefaultWindowProc (HWND hWindow, UINT wndMsg, WPARAM wParam, LPARAM lParam)
 This function is our message-handling callback function.
 

Constructor & Destructor Documentation

◆ ~PureWindowImpl()

PureWindowImpl::~PureWindowImpl ( )
virtual

Definition at line 266 of file PureWindow.cpp.

◆ PureWindowImpl() [1/2]

PureWindowImpl::PureWindowImpl ( PGEcfgProfiles & cfgProfiles,
PGEInputHandler & inputHandler )
explicitprivate

Definition at line 1432 of file PureWindow.cpp.

◆ PureWindowImpl() [2/2]

PureWindowImpl::PureWindowImpl ( const PureWindowImpl & other)
private

Definition at line 1443 of file PureWindow.cpp.

Member Function Documentation

◆ actualCreateWindow()

TPureBool PureWindowImpl::actualCreateWindow ( TPureUInt width,
TPureUInt height,
TPureBool bFullscreen,
const char * caption,
const WNDCLASS & clWnd )
private

This creates the window actually.

This creates the windows actually.

Updates the following members: sCaption, bBtnMin, bBorder, bSysMenu, bVisibleCursor, enabled, dwStyle, dwStyleEx, rectWindow, nClientWidthOrig, nClientHeightOrig, nClientWidth, nClientHeight, hWindow.

Parameters
widthWidth of the window to be created.
heightHeight of the window to be created.
bFullscreenShould it be a fullscreen window?
captionCaption of the window.
clWndA properly filled and registered WNDCLASS. You can use setupWindowClass() to have such.
Returns
True on success, false on failure.

Definition at line 1529 of file PureWindow.cpp.

◆ Close()

void PureWindowImpl::Close ( )
virtual

Closes the window.

No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Implements PureWindow.

Definition at line 1353 of file PureWindow.cpp.

◆ Deinitialize()

void PureWindowImpl::Deinitialize ( )
virtual

This deletes the window, then initialize() can be called again later.

Implements PureWindow.

Definition at line 385 of file PureWindow.cpp.

◆ getAutoCameraWarningState()

TPureBool PureWindowImpl::getAutoCameraWarningState ( ) const
virtual

Gets whether automatic camera warning on resize is enabled or not.

Enabled by default.

Returns
True if automatic camera warning on resize is enabled, false otherwise.

Implements PureWindow.

Definition at line 1219 of file PureWindow.cpp.

◆ getBottomFrameHeight()

TPureUInt PureWindowImpl::getBottomFrameHeight ( ) const
virtual

Gets window bottom frame height.

The window has a bottom frame, right under the client area. You can resize the window vertically by dragging the bottom frame with the mouse if vertical resizing is enabled.

Returns
Window bottom frame width in pixels.

Implements PureWindow.

Definition at line 616 of file PureWindow.cpp.

◆ getCaption()

const string & PureWindowImpl::getCaption ( ) const
virtual

Gets the window caption.

Returns
Caption of the window.

Implements PureWindow.

Definition at line 792 of file PureWindow.cpp.

◆ getCaptionHeight()

TPureUInt PureWindowImpl::getCaptionHeight ( ) const
virtual

Gets window caption area height.

The caption area is within the title bar area and its height is smaller than the title bar height.

Returns
Window caption area height in pixels.

Implements PureWindow.

Definition at line 628 of file PureWindow.cpp.

◆ getClientHeight()

TPureUInt PureWindowImpl::getClientHeight ( ) const
virtual

Gets window client height.

This area is where we render to.

Returns
Window client height in pixels.

Implements PureWindow.

Definition at line 558 of file PureWindow.cpp.

◆ getClientWidth()

TPureUInt PureWindowImpl::getClientWidth ( ) const
virtual

Gets window client width.

This area is where we render to.

Returns
Window client width in pixels.

Implements PureWindow.

Definition at line 480 of file PureWindow.cpp.

◆ getConsole()

CConsole & PureWindowImpl::getConsole ( ) const

Returns access to console preset with logger module name as this class.

Intentionally not virtual, so the getConsole() in derived class should hide this instead of overriding.

Returns
Console instance used by this class.

Definition at line 278 of file PureWindow.cpp.

◆ getHeight()

TPureUInt PureWindowImpl::getHeight ( ) const
virtual

Gets window height.

Returns
Window height in pixels.

Implements PureWindow.

Definition at line 522 of file PureWindow.cpp.

◆ getLoggerModuleName()

const char * PureWindowImpl::getLoggerModuleName ( )
static

Returns the logger module name of this class.

Intentionally not virtual, so derived class should hide this instead of overriding. Not even private, so user can also access this from outside, for any reason like controlling log filtering per logger module name.

Returns
The logger module name of this class.

Definition at line 291 of file PureWindow.cpp.

◆ getSideFrameWidth()

TPureUInt PureWindowImpl::getSideFrameWidth ( ) const
virtual

Gets window side frame width.

The window has 2 side frames, a left and a right frame. The client are is between the 2 side frames. You can resize the window horizontally by dragging the side frames with the mouse if horizontal resizing is enabled.

Returns
Window side frame width in pixels.

Implements PureWindow.

Definition at line 603 of file PureWindow.cpp.

◆ getTitleBarHeight()

TPureUInt PureWindowImpl::getTitleBarHeight ( ) const
virtual

Gets window title bar height.

The title bar is the bar containing the caption and the upper frame of the window. Its height is bigger than the caption height.

Returns
Window title bar height in pixels.

Implements PureWindow.

Definition at line 640 of file PureWindow.cpp.

◆ getWidth()

TPureUInt PureWindowImpl::getWidth ( ) const
virtual

Gets window width.

Returns
Window width in pixels.

Implements PureWindow.

Definition at line 444 of file PureWindow.cpp.

◆ getWindowProc()

WNDPROC PureWindowImpl::getWindowProc ( ) const
virtual

Gets the message handling window procedure of this window.

Returns
The message handling procedure of this window.

Implements PureWindow.

Definition at line 1099 of file PureWindow.cpp.

◆ getWndDC()

HDC PureWindowImpl::getWndDC ( ) const
virtual

Gets window Device Context.

Returns
Device context of window, or NULL before initialization.

Implements PureWindow.

Definition at line 722 of file PureWindow.cpp.

◆ getWndHandle()

HWND PureWindowImpl::getWndHandle ( ) const
virtual

Gets window handle.

Returns
Handle of window.

Implements PureWindow.

Definition at line 712 of file PureWindow.cpp.

◆ getX()

TPureUInt PureWindowImpl::getX ( ) const
virtual

Gets window X-coordinate.

Returns
X-coordinate of the window in screen pixels.

Implements PureWindow.

Definition at line 650 of file PureWindow.cpp.

◆ getY()

TPureUInt PureWindowImpl::getY ( ) const
virtual

Gets window Y-coordinate.

Returns
Y-coordinate of the window in screen pixels.

Implements PureWindow.

Definition at line 681 of file PureWindow.cpp.

◆ hasBorder()

TPureBool PureWindowImpl::hasBorder ( ) const
virtual

Gets whether window has border or not.

Implements PureWindow.

Definition at line 920 of file PureWindow.cpp.

◆ hasCloseRequest()

TPureBool PureWindowImpl::hasCloseRequest ( ) const
virtual

Gets whether the window has a close request or not.

Returns
True if the window has detected a close request (WM_CLOSE) during message processing, false otherwise.

Implements PureWindow.

Definition at line 1152 of file PureWindow.cpp.

◆ hasMaxButton()

TPureBool PureWindowImpl::hasMaxButton ( ) const
virtual

Gets whether window has maximize/restore button or not.

This button maximizes the window or restores to original size.

Returns
True if the window has maximize/restore button, false otherwise.

Implements PureWindow.

Definition at line 1031 of file PureWindow.cpp.

◆ hasMinButton()

TPureBool PureWindowImpl::hasMinButton ( ) const
virtual

Gets whether window has minimize button or not.

This button minimizes the window to the Taskbar.

Returns
True if the window has minimize button, false otherwise.

Implements PureWindow.

Definition at line 994 of file PureWindow.cpp.

◆ hasSysMenu()

TPureBool PureWindowImpl::hasSysMenu ( ) const
virtual

Gets whether window has sysmenu or not.

Sysmenu is the area where the caption of the window can be found.

Returns
True if window has sysmenu, false otherwise.

Implements PureWindow.

Definition at line 957 of file PureWindow.cpp.

◆ Hide()

void PureWindowImpl::Hide ( )
virtual

Hides the window.

No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Implements PureWindow.

Definition at line 1283 of file PureWindow.cpp.

◆ initialize()

TPureBool PureWindowImpl::initialize ( TPureUInt width,
TPureUInt height,
TPureBool bFullscreen,
const char * caption,
HWND window = NULL )
virtual

This creates the window actually.

Only has effect if the window is not already initialized. Fails if either width or height is 0.

Parameters
widthWidth of the window to be created. Ignored if an already existing window is specified.
heightHeight of the window to be created. Ignored if an already existing window is specified.
bFullscreenShould it be a fullscreen window? Ignored if an already existing window is specified.
captionCaption of the window. Ignored if an already existing window is specified.
windowIf a target window is already created for rendering purpose, it can be specified here. To be used for legacy reasons only. If specified, no new window will be actually created but the given window will be treated as it was created by this class instance. Properties of this window should be managed by the owner.
Returns
True on success, false on fail.

Implements PureWindow.

Definition at line 312 of file PureWindow.cpp.

◆ isActive()

TPureBool PureWindowImpl::isActive ( ) const
virtual

Gets whether window is active or not.

If window is active, it receives keyboard input.

Returns
True if window is active, false otherwise.

Implements PureWindow.

Definition at line 733 of file PureWindow.cpp.

◆ isAutoCleanupOnQuitOn()

TPureBool PureWindowImpl::isAutoCleanupOnQuitOn ( ) const
virtual

Gets whether automatic cleanup of window on close request is enabled or not.

Enabled by default.

Returns
True if automatic cleanup of window on close request is enabled, false otherwise.

Implements PureWindow.

Definition at line 1191 of file PureWindow.cpp.

◆ isAutoRedrawAllOnPosChange()

TPureBool PureWindowImpl::isAutoRedrawAllOnPosChange ( ) const
virtual

Gets whether automatic redraw of window contents on position change is enabled or not.

Enabled by default.

Returns
True if automatic redraw of window contents on position change is enabled, false otherwise.

Implements PureWindow.

Definition at line 1163 of file PureWindow.cpp.

◆ isCursorVisible()

TPureBool PureWindowImpl::isCursorVisible ( ) const
virtual

Gets whether the mouse cursor is visible or not within the window area.

Returns
True if the mouse cursor is visible within the window area, false otherwise.

Implements PureWindow.

Definition at line 1366 of file PureWindow.cpp.

◆ isEnabled()

TPureBool PureWindowImpl::isEnabled ( ) const
virtual

Gets whether window is enabled or not.

If not enabled, it doesn't receive any input neither from keyboard nor mouse.

Returns
True if window is enabled, false otherwise.

Implements PureWindow.

Definition at line 1068 of file PureWindow.cpp.

◆ isInitialized()

TPureBool PureWindowImpl::isInitialized ( ) const
virtual

Gets whether the window is initialized.

Implements PureWindow.

Definition at line 419 of file PureWindow.cpp.

◆ isResizable()

TPureBool PureWindowImpl::isResizable ( ) const
virtual

Gets whether window is fully resizable.

Returns
True if the window is resizable both horizontally and vertically, false otherwise.

Implements PureWindow.

Definition at line 880 of file PureWindow.cpp.

◆ isResizableH()

TPureBool PureWindowImpl::isResizableH ( ) const
virtual

Gets whether window is resizable horizontally.

Returns
True if window is resizable horizontally, false otherwise.

Implements PureWindow.

Definition at line 822 of file PureWindow.cpp.

◆ isResizableV()

TPureBool PureWindowImpl::isResizableV ( ) const
virtual

Gets whether window is resizable vertically.

Returns
True if window is resizable vertically, false otherwise.

Implements PureWindow.

Definition at line 851 of file PureWindow.cpp.

◆ isTopMost()

TPureBool PureWindowImpl::isTopMost ( ) const
virtual

Gets whether window is topmost or not.

Topmost property does not necessarily bring the window above all other windows, but it will be above all non-topmost windows. Read MSDN documentation for details.

Returns
True if window is topmost, false otherwise.

Implements PureWindow.

Definition at line 760 of file PureWindow.cpp.

◆ Maximize()

void PureWindowImpl::Maximize ( )
virtual

Maximizes the window.

Equivalent to clicking the maximize button in the sysmenu. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Implements PureWindow.

Definition at line 1319 of file PureWindow.cpp.

◆ Minimize()

void PureWindowImpl::Minimize ( )
virtual

Minimizes the window, so it will be visible only on the Taskbar.

Equivalent to clicking the minimize button in the sysmenu. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Implements PureWindow.

Definition at line 1301 of file PureWindow.cpp.

◆ onActivate()

LRESULT PureWindowImpl::onActivate ( TPureBool isActive)
private

Definition at line 1584 of file PureWindow.cpp.

◆ onClose()

LRESULT PureWindowImpl::onClose ( )
private

Definition at line 1627 of file PureWindow.cpp.

◆ onDestroy()

LRESULT PureWindowImpl::onDestroy ( )
private

Definition at line 1635 of file PureWindow.cpp.

◆ onInput()

LRESULT PureWindowImpl::onInput ( HRAWINPUT handle)
private

Definition at line 1642 of file PureWindow.cpp.

◆ onKeyDown()

LRESULT PureWindowImpl::onKeyDown ( TPureInt key)
private

Definition at line 1667 of file PureWindow.cpp.

◆ onKeyUp()

LRESULT PureWindowImpl::onKeyUp ( TPureInt key)
private

Definition at line 1658 of file PureWindow.cpp.

◆ onMouseDown()

LRESULT PureWindowImpl::onMouseDown ( PGEInputMouse::MouseButton btn,
WPARAM wParam,
TPureInt x,
TPureInt y )
private

Definition at line 1700 of file PureWindow.cpp.

◆ onMouseMove()

LRESULT PureWindowImpl::onMouseMove ( TPureInt x,
TPureInt y )
private

Definition at line 1676 of file PureWindow.cpp.

◆ onMouseUp()

LRESULT PureWindowImpl::onMouseUp ( PGEInputMouse::MouseButton btn,
WPARAM wParam,
TPureInt x,
TPureInt y )
private

Definition at line 1693 of file PureWindow.cpp.

◆ onMouseWheel()

LRESULT PureWindowImpl::onMouseWheel ( TPureShort nWheel)
private

Definition at line 1686 of file PureWindow.cpp.

◆ onPosChanged()

LRESULT PureWindowImpl::onPosChanged ( const LPWINDOWPOS newPos)
private

Definition at line 1723 of file PureWindow.cpp.

◆ onRedrawRequired()

LRESULT PureWindowImpl::onRedrawRequired ( )
private

Definition at line 1707 of file PureWindow.cpp.

◆ onSysCommand()

LRESULT PureWindowImpl::onSysCommand ( WPARAM wParam,
LPARAM lParam )
private

Definition at line 1592 of file PureWindow.cpp.

◆ operator=()

PureWindowImpl & PureWindowImpl::operator= ( const PureWindowImpl & )
private

Definition at line 1451 of file PureWindow.cpp.

◆ ProcessMessages()

void PureWindowImpl::ProcessMessages ( )
virtual

Processes the queued window messages.

Calls Deinitialize() if detects a close request (WM_CLOSE) AND "automatic cleanup on close request" is enabled. Calling this often is recommended (i.e. once somewhere in a main loop) to make the window react to user activity without delay. No effect before initialization.

Implements PureWindow.

Definition at line 1132 of file PureWindow.cpp.

◆ ResetDefaults()

void PureWindowImpl::ResetDefaults ( )
virtual

Resets the default settings.

Equivalent to calling these functions:

  • SetAutoCameraWarningState( true )
  • SetAutoCleanupOnQuit( true )
  • SetAutoRedrawOnPosChange( true ).

Implements PureWindow.

Definition at line 432 of file PureWindow.cpp.

◆ Restore()

void PureWindowImpl::Restore ( )
virtual

Restores the window to the previous state Equivalent to clicking the restore button in the sysmenu.

No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Implements PureWindow.

Definition at line 1337 of file PureWindow.cpp.

◆ SetActive()

void PureWindowImpl::SetActive ( )
virtual

Sets the window active.

If window is active, it receives keyboard input. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Implements PureWindow.

Definition at line 745 of file PureWindow.cpp.

◆ SetAutoCameraWarningState()

void PureWindowImpl::SetAutoCameraWarningState ( TPureBool state)
virtual

Sets whether automatic camera warning on resize is enabled or not.

If state is true, the cameras will be automatically warned about a relevant property change, i.e. window resizing so they can readjust their properties. Enabled by default. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateAutomatic camera warning to be enabled or not.

Implements PureWindow.

Definition at line 1233 of file PureWindow.cpp.

◆ SetAutoCleanupOnQuitOn()

void PureWindowImpl::SetAutoCleanupOnQuitOn ( TPureBool state)
virtual

Sets whether automatic cleanup of window on close request is enabled or not.

If state is true, the window will automatically destroy itself on close request in the next ProcessMessages(). Enabled by default. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateAutomatic cleanup of window to be enabled or not.

Implements PureWindow.

Definition at line 1205 of file PureWindow.cpp.

◆ SetAutoRedrawAllOnPosChange()

void PureWindowImpl::SetAutoRedrawAllOnPosChange ( TPureBool state)
virtual

Sets whether automatic redraw of window contents on position change is enabled or not.

If state is true, window content will be redrawed on moving or resizing the window. Enabled by default. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateAutomatic redraw of window contents to be enabled or not.

Implements PureWindow.

Definition at line 1177 of file PureWindow.cpp.

◆ SetBorder()

void PureWindowImpl::SetBorder ( TPureBool state)
virtual

Sets whether window has border or not.

No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateShould window has border or not.

Implements PureWindow.

Definition at line 933 of file PureWindow.cpp.

◆ SetCaption()

void PureWindowImpl::SetCaption ( const std::string & newcaption)
virtual

Sets the window caption.

No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
newcaptionCaption to be set for the window.

Implements PureWindow.

Definition at line 805 of file PureWindow.cpp.

◆ SetClientHeight()

void PureWindowImpl::SetClientHeight ( TPureUInt newheight)
virtual

Sets window client width.

This area is where we render to. Has no effect before initialization and in fullscreen mode. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
newheightRequested window client height in pixels.

Implements PureWindow.

Definition at line 572 of file PureWindow.cpp.

◆ SetClientWidth()

void PureWindowImpl::SetClientWidth ( TPureUInt newwidth)
virtual

Sets window client width.

This area is where we render to. Has no effect before initialization and in fullscreen mode. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
newwidthRequested window client width in pixels.

Implements PureWindow.

Definition at line 494 of file PureWindow.cpp.

◆ SetCursorVisible()

void PureWindowImpl::SetCursorVisible ( TPureBool state)
virtual

Sets whether the mouse cursor is visible or not within the window area.

No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateMouse cursor should be visible within the window area or not.

Implements PureWindow.

Definition at line 1379 of file PureWindow.cpp.

◆ SetEnabled()

void PureWindowImpl::SetEnabled ( TPureBool state)
virtual

Sets whether window is enabled or not.

If not enabled, it doesn't receive any input neither from keyboard nor mouse. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateWindow should be enabled or not.

Implements PureWindow.

Definition at line 1082 of file PureWindow.cpp.

◆ SetHeight()

void PureWindowImpl::SetHeight ( TPureUInt newheight)
virtual

Sets window height.

Has no effect before initialization and in fullscreen mode. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
newheightRequested window height in pixels.

Implements PureWindow.

Definition at line 535 of file PureWindow.cpp.

◆ SetMaxButton()

void PureWindowImpl::SetMaxButton ( TPureBool state)
virtual

Sets whether window has maximize/restore button or not.

This button maximizes the window or restores to original size. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateShould window has maximize/restore button or not.

Implements PureWindow.

Definition at line 1045 of file PureWindow.cpp.

◆ SetMinButton()

void PureWindowImpl::SetMinButton ( TPureBool state)
virtual

Sets whether window has minimize button or not.

This button minimizes the window to the Taskbar. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateShould window has minimize button or not.

Implements PureWindow.

Definition at line 1008 of file PureWindow.cpp.

◆ SetPropertiesBeforeInitialize()

void PureWindowImpl::SetPropertiesBeforeInitialize ( )
private

Sets default values to properties, used by ctor and Deinitialize().

Definition at line 1460 of file PureWindow.cpp.

◆ SetResizable()

void PureWindowImpl::SetResizable ( TPureBool state)
virtual

Sets whether window is fully resizable.

If state is true, the window will be resizable both horizontally and vertically. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateShould window be resizable both horizontally and vertically or not.

Implements PureWindow.

Definition at line 894 of file PureWindow.cpp.

◆ SetResizableH()

void PureWindowImpl::SetResizableH ( TPureBool state)
virtual

Sets whether window is resizable horizontally.

No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateShould window be resizable horizontally or not.

Implements PureWindow.

Definition at line 835 of file PureWindow.cpp.

◆ SetResizableV()

void PureWindowImpl::SetResizableV ( TPureBool state)
virtual

Sets whether window is resizable vertically.

No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateShould window be resizable vertically or not.

Implements PureWindow.

Definition at line 864 of file PureWindow.cpp.

◆ SetSysMenu()

void PureWindowImpl::SetSysMenu ( TPureBool state)
virtual

Sets whether window has sysmenu or not.

Sysmenu is the area where the caption of the window can be found. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateShould window has sysmenu or not.

Implements PureWindow.

Definition at line 971 of file PureWindow.cpp.

◆ SetTopMost()

void PureWindowImpl::SetTopMost ( TPureBool state)
virtual

Sets the window topmost property.

Topmost property does not necessarily bring the window above all other windows, but it will be above all non-topmost windows. Read MSDN documentation for details. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
stateWindow topmost property to be this.

Implements PureWindow.

Definition at line 774 of file PureWindow.cpp.

◆ setupWindowClass()

TPureBool PureWindowImpl::setupWindowClass ( WNDCLASS & clWnd)
private

Fills the given WNDCLASS structure and registers it.

Parameters
clWndThe WNDCLASS structure to be filled and registered.
Returns
True on success, false on failure.

Definition at line 1492 of file PureWindow.cpp.

◆ SetWidth()

void PureWindowImpl::SetWidth ( TPureUInt newwidth)
virtual

Sets window width.

Has no effect before initialization and in fullscreen mode. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
newwidthRequested window width in pixels.

Implements PureWindow.

Definition at line 457 of file PureWindow.cpp.

◆ SetWindowProc()

void PureWindowImpl::SetWindowProc ( const WNDPROC windowproc)
virtual

Sets the message handling window procedure of this window.

The engine provides a message handling procedure by default, so it's not compulsory to set a custom procedure. No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
windowprocA custom message handling window procedure for this window. If NULL, the engine's default message handling procedure will be set again.

Implements PureWindow.

Definition at line 1113 of file PureWindow.cpp.

◆ SetX()

void PureWindowImpl::SetX ( TPureUInt newx)
virtual

Sets window X-coordinate.

Has no effect before initialization and in fullscreen mode. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
newxX-coordinate of window in screen pixels.

Implements PureWindow.

Definition at line 663 of file PureWindow.cpp.

◆ SetY()

void PureWindowImpl::SetY ( TPureUInt newy)
virtual

Sets window Y-coordinate.

Has no effect before initialization and in fullscreen mode. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Parameters
newyY-coordinate of window in screen pixels.

Implements PureWindow.

Definition at line 694 of file PureWindow.cpp.

◆ Show()

void PureWindowImpl::Show ( )
virtual

Shows the window.

No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Implements PureWindow.

Definition at line 1247 of file PureWindow.cpp.

◆ ShowFull()

void PureWindowImpl::ShowFull ( )
virtual

Shows and brings the window to front and sets the focus to it.

No effect before initialization. No effect if an already created window was specified for initialize(), in such case the owner of the window is responsible for setting its properties.

Implements PureWindow.

Definition at line 1264 of file PureWindow.cpp.

◆ WriteSettings()

void PureWindowImpl::WriteSettings ( )
virtual

Writes the window properties to the console window.

No effect before initialization.

Implements PureWindow.

Definition at line 1398 of file PureWindow.cpp.

Friends And Related Symbol Documentation

◆ PuredefaultWindowProc

LRESULT __stdcall PuredefaultWindowProc ( HWND hWindow,
UINT wndMsg,
WPARAM wParam,
LPARAM lParam )
friend

This function is our message-handling callback function.

Some message is handled by this instead of the default DefWindowProc().

Returns
0 if the given message has been handled by this function, otherwise the result of DefWindowProc().

Definition at line 226 of file PureWindow.cpp.

◆ PureWindow

friend class PureWindow
friend

Definition at line 215 of file PureWindow.cpp.

Member Data Documentation

◆ bActive

TPureBool PureWindowImpl::bActive
private

Is the window active or not.

Definition at line 171 of file PureWindow.cpp.

◆ bAutoCameraWarn

TPureBool PureWindowImpl::bAutoCameraWarn
private

If true, the window will notify cameras about resizing.

Definition at line 174 of file PureWindow.cpp.

◆ bAutoCleanupOnQuit

TPureBool PureWindowImpl::bAutoCleanupOnQuit
private

If true, the window will close itself on close request.

Definition at line 173 of file PureWindow.cpp.

◆ bAutoRedrawOnPosChange

TPureBool PureWindowImpl::bAutoRedrawOnPosChange
private

If true, the window will redraw its content on position change.

Definition at line 175 of file PureWindow.cpp.

◆ bBorder

TPureBool PureWindowImpl::bBorder
private

Does the window have border or not.

Definition at line 166 of file PureWindow.cpp.

◆ bBtnMax

TPureBool PureWindowImpl::bBtnMax
private

Does the window have a maximize button or not.

Definition at line 165 of file PureWindow.cpp.

◆ bBtnMin

TPureBool PureWindowImpl::bBtnMin
private

Does the window have a minimize button or not.

Definition at line 164 of file PureWindow.cpp.

◆ bCloseRequested

TPureBool PureWindowImpl::bCloseRequested
private

True if a close request has been captured by the window.

Definition at line 170 of file PureWindow.cpp.

◆ bExternalOwner

TPureBool PureWindowImpl::bExternalOwner
private

If true, then an existing window was specified at init, thus we neither create nor delete the window.

Definition at line 148 of file PureWindow.cpp.

◆ bResizingH

TPureBool PureWindowImpl::bResizingH
private

Is horizontal resizing enabled or not.

Definition at line 168 of file PureWindow.cpp.

◆ bResizingV

TPureBool PureWindowImpl::bResizingV
private

Is vertical resizing enabled or not.

Definition at line 169 of file PureWindow.cpp.

◆ bSysMenu

TPureBool PureWindowImpl::bSysMenu
private

Does the window have a sysmenu or not.

Definition at line 167 of file PureWindow.cpp.

◆ bTopMost

TPureBool PureWindowImpl::bTopMost
private

Is the window topmost or not.

Definition at line 172 of file PureWindow.cpp.

◆ bVisibleCursor

TPureBool PureWindowImpl::bVisibleCursor
private

Is the mouse cursor visible or not.

Definition at line 163 of file PureWindow.cpp.

◆ clWindow

WNDCLASS PureWindowImpl::clWindow
private

Window class.

Definition at line 150 of file PureWindow.cpp.

◆ DEF_AUTOCAMWARN

const TPureBool PureWindowImpl::DEF_AUTOCAMWARN = true
staticprivate

Default value of automatic camera warning on resizing.

Definition at line 135 of file PureWindow.cpp.

◆ DEF_AUTOCLEANUP

const TPureBool PureWindowImpl::DEF_AUTOCLEANUP = true
staticprivate

Default value of automatic cleanup on close request.

Definition at line 134 of file PureWindow.cpp.

◆ DEF_REDRAWALL_WNDPOSCHNG

const TPureBool PureWindowImpl::DEF_REDRAWALL_WNDPOSCHNG = true
staticprivate

Default value of automatic redrawing of window content on position change.

Definition at line 136 of file PureWindow.cpp.

◆ dwStyle

DWORD PureWindowImpl::dwStyle
private

Definition at line 149 of file PureWindow.cpp.

◆ dwStyleEx

DWORD PureWindowImpl::dwStyleEx
private

Window styles.

Definition at line 149 of file PureWindow.cpp.

◆ enabled

TPureBool PureWindowImpl::enabled
private

Is the window enabled or not.

Definition at line 162 of file PureWindow.cpp.

◆ hWindow

HWND PureWindowImpl::hWindow
private

Window Handle.

Definition at line 147 of file PureWindow.cpp.

◆ infoTitlebar

TITLEBARINFOEX PureWindowImpl::infoTitlebar
private

Extended title bar info, for Vista and newer.

Definition at line 151 of file PureWindow.cpp.

◆ input

PGEInputHandler& PureWindowImpl::input
private

Our source of input.

Definition at line 143 of file PureWindow.cpp.

◆ m_bFullscreen

TPureBool PureWindowImpl::m_bFullscreen
private

Is it a fullscreen window or not.

Definition at line 160 of file PureWindow.cpp.

◆ m_cfgProfiles

PGEcfgProfiles& PureWindowImpl::m_cfgProfiles
private

Definition at line 142 of file PureWindow.cpp.

◆ nBottomFrameHeight

TPureUInt PureWindowImpl::nBottomFrameHeight
private

Bottom frame height.

Definition at line 157 of file PureWindow.cpp.

◆ nCaptionHeight

TPureUInt PureWindowImpl::nCaptionHeight
private

Caption area height.

Definition at line 158 of file PureWindow.cpp.

◆ nClientHeightOrig

TPureUInt PureWindowImpl::nClientHeightOrig
private

Original height of the window's client area.

Definition at line 155 of file PureWindow.cpp.

◆ nClientWidthOrig

TPureUInt PureWindowImpl::nClientWidthOrig
private

Original width of the window's client area.

Definition at line 154 of file PureWindow.cpp.

◆ nSideFrameWidth

TPureUInt PureWindowImpl::nSideFrameWidth
private

Side frame width.

Definition at line 156 of file PureWindow.cpp.

◆ nTitleBarHeight

TPureUInt PureWindowImpl::nTitleBarHeight
private

Title bar height.

Definition at line 159 of file PureWindow.cpp.

◆ rawInput

RAWINPUT PureWindowImpl::rawInput
private

For raw mouse input.

Definition at line 144 of file PureWindow.cpp.

◆ rawInputSize

UINT PureWindowImpl::rawInputSize
private

Size of RAWINPUT.

Definition at line 145 of file PureWindow.cpp.

◆ rectWindowClient

RECT PureWindowImpl::rectWindowClient
private

Position and size of window client area.

Definition at line 153 of file PureWindow.cpp.

◆ rectWindowFull

RECT PureWindowImpl::rectWindowFull
private

Position and full size of the window.

Definition at line 152 of file PureWindow.cpp.

◆ sCaption

std::string PureWindowImpl::sCaption
private

Window title.

Definition at line 161 of file PureWindow.cpp.

◆ sharedSettings

const PureSharedSettings& PureWindowImpl::sharedSettings
private

Pointer to shared settings, const because we just reading it.

Definition at line 140 of file PureWindow.cpp.


The documentation for this class was generated from the following file: