Win32Window

Engine/source/windowManager/win32/win32Window.h

Implementation of a window on Win32.

More...

Classes:

Active window list

Items used to track window instances.

Which manager created us?

Which window comes next in list?

Window Information

HWND

Our HWND - Win32 window handle.

HWND

Our former Parent HWND.

DWORD

The Win32 window style we want to use when windowed.

The GFX device that we're tied to.

Reference to the render target allocated on this window.

Our current size/resolution/fullscreen status.

Our position on the desktop.

HACCEL

Windows HACCEL for accelerators.

Keyboard accelerators for menus.

bool

Is the mouse locked to this window?

The position the cursor was at when a mouse lock occured.

bool

Determines whether this window should lock the mouse when it has an opportunity.

bool

When set, we don't trigger device resets due to sizing events.

HMENU

Menu associated with this window. This is a passive property of the window and is not required to be used at all.

bool

Do we have a fullscreen window style set?

Public Types

AcceleratorList 

Private Types

Vector< ACCEL >
WinAccelList 

Public Friends

Private Functions

Helper to allocate our Win32 window class.

Add an accelerator to the list of accelerators for this window. Intended for use by addAccelerators()

Remove an accelerator from the list of accelerators for this window. Intended for use by removeAccelerators()

Private Static Functions

LRESULT PASCAL
WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

Windows message handler callback.

Public Functions

_setFullscreen(const bool fullscreen)

Add a list of accelerators to this window.

bool

If we're fullscreen, this function returns us to desktop mode.

Convert the coordinate given in this window space to screen coordinates.

Destroy the window on screen.

Provide a simple GDI-based render for when the game is not rendering.

Get the position and size (fullscreen windows are always at (0,0)).

const char *

Get the window's caption.

Get the Client Area Extent (Resolution) of this window.

Return a pointer to the GFX device this window is bound to.

Return a pointer to this window's render target.

HWND &

Return the HWND (win32 window handle) for this window.

HMENU &
void *

Return the platform specific object needed to create or attach an accelerated graohics drawing context on or to the window.

Get the position of this window.

Get our current video mode - if the window has been resized, it will reflect this.

Get the ID that uniquely identifies this window in the context of its window manager.

hide()

Hide the window on screen.

bool

Returns true if

info
matches an accelerator.

bool

Returns true if the window has input focus.

bool
bool

Returns true if the window is maximized.

bool

Returns true if the window is minimized.

bool

Is the mouse locked ?

bool

Returns true if the window is instantiated in the OS.

bool

Returns true if the window is visible.

Maximize the window on screen.

Minimize the window on screen.

Remove a list of accelerators from this window.

Restore the window from a Maximized or Minimized state.

Convert the given screen coordinates to coordinates in this window space.

setBounds(const RectI & newBounds)

The bounds of a Window are defined as the entire area occupied by that Window.

bool
setCaption(const char * cap)

Set the window's caption.

The Client Rectangle or "Render Area" of a window is the area that is occupied by a given client that is rendering to that window.

Set Focused State (Foreground)

setMenuHandle(HMENU menuHandle)
setMouseLocked(bool enable)

Lock the mouse to this window.

setPosition(const Point2I newPosition)

The Position of a window is always in relation to the very upper left of the window.

bool
setSize(const Point2I & newSize)

Resize the window to have a new size (but be in the same position).

bool

Should the mouse be locked at the next opportunity ?

show()

Show the window on screen.

bool
translateMessage(MSG & msg)

Allow windows to translate messages. Used for accelerators.

Public Static Functions

Return the class name for the curtain window class.

Return the class name for the windows we create with this class.

Detailed Description

Implementation of a window on Win32.

Active window list

Items used to track window instances.

Win32WindowManager * mOwningManager 

Which manager created us?

Win32Window * mNextWindow 

Which window comes next in list?

Window Information

HWND mWindowHandle 

Our HWND - Win32 window handle.

HWND mOldParent 

Our former Parent HWND.

DWORD mWindowedWindowStyle 

The Win32 window style we want to use when windowed.

GFXDevice * mDevice 

The GFX device that we're tied to.

GFXWindowTargetRef mTarget 

Reference to the render target allocated on this window.

GFXVideoMode mVideoMode 

Our current size/resolution/fullscreen status.

Point2I mPosition 

Our position on the desktop.

HACCEL mAccelHandle 

Windows HACCEL for accelerators.

WinAccelList mWinAccelList 

Keyboard accelerators for menus.

bool mMouseLocked 

Is the mouse locked to this window?

Point2I mMouseLockPosition 

The position the cursor was at when a mouse lock occured.

bool mShouldLockMouse 

Determines whether this window should lock the mouse when it has an opportunity.

bool mSuppressReset 

When set, we don't trigger device resets due to sizing events.

HMENU mMenuHandle 

Menu associated with this window. This is a passive property of the window and is not required to be used at all.

bool mFullscreen 

Do we have a fullscreen window style set?

Public Types

typedef Vector< Accelerator > AcceleratorList 

Private Types

typedef Vector< ACCEL > WinAccelList 

Public Friends

Private Functions

_registerWindowClass()

Helper to allocate our Win32 window class.

_unregisterWindowClass()

addAccelerator(Accelerator & accel)

Add an accelerator to the list of accelerators for this window. Intended for use by addAccelerators()

removeAccelerator(Accelerator & accel)

Remove an accelerator from the list of accelerators for this window. Intended for use by removeAccelerators()

Private Static Functions

WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

Windows message handler callback.

Public Functions

Win32Window()

~Win32Window()

_setFullscreen(const bool fullscreen)

Reimplemented from: PlatformWindow

_setVideoMode(const GFXVideoMode & mode)

Reimplemented from: PlatformWindow

addAccelerators(AcceleratorList & list)

Add a list of accelerators to this window.

centerWindow()

Reimplemented from: PlatformWindow

clearFullscreen()

Reimplemented from: PlatformWindow

clientToScreen(const Point2I & point)

Reimplemented from: PlatformWindow

close()

Reimplemented from: PlatformWindow

defaultRender()

Provide a simple GDI-based render for when the game is not rendering.

getBounds()

Reimplemented from: PlatformWindow

getCaption()

Reimplemented from: PlatformWindow

getClientExtent()

Reimplemented from: PlatformWindow

getGFXDevice()

Reimplemented from: PlatformWindow

getGFXTarget()

Reimplemented from: PlatformWindow

getHWND()

Return the HWND (win32 window handle) for this window.

getMenuHandle()

getNextWindow()

Reimplemented from: PlatformWindow

getPlatformDrawable()

Reimplemented from: PlatformWindow

getPosition()

Reimplemented from: PlatformWindow

getSystemWindow(const WindowSystem system)

Reimplemented from: PlatformWindow

getVideoMode()

Reimplemented from: PlatformWindow

getWindowId()

Reimplemented from: PlatformWindow

hide()

Reimplemented from: PlatformWindow

isAccelerator(const InputEventInfo & info)

Returns true if

info
matches an accelerator.

isFocused()

Reimplemented from: PlatformWindow

isFullscreen()

Reimplemented from: PlatformWindow

isMaximized()

Reimplemented from: PlatformWindow

isMinimized()

Reimplemented from: PlatformWindow

isMouseLocked()

Reimplemented from: PlatformWindow

isOpen()

Reimplemented from: PlatformWindow

isVisible()

Reimplemented from: PlatformWindow

maximize()

Reimplemented from: PlatformWindow

minimize()

Reimplemented from: PlatformWindow

removeAccelerators(AcceleratorList & list)

Remove a list of accelerators from this window.

restore()

Reimplemented from: PlatformWindow

screenToClient(const Point2I & point)

Reimplemented from: PlatformWindow

setBounds(const RectI & newBounds)

Reimplemented from: PlatformWindow

setCaption(const char * cap)

Reimplemented from: PlatformWindow

setClientExtent(const Point2I newExtent)

Reimplemented from: PlatformWindow

setFocus()

Reimplemented from: PlatformWindow

setMenuHandle(HMENU menuHandle)

setMouseLocked(bool enable)

Reimplemented from: PlatformWindow

setPosition(const Point2I newPosition)

Reimplemented from: PlatformWindow

setSize(const Point2I & newSize)

Reimplemented from: PlatformWindow

shouldLockMouse()

Reimplemented from: PlatformWindow

show()

Reimplemented from: PlatformWindow

translateMessage(MSG & msg)

Allow windows to translate messages. Used for accelerators.

Public Static Functions

getCurtainWindowClassName()

Return the class name for the curtain window class.

getWindowClassName()

Return the class name for the windows we create with this class.