PlatformWindowSDL
Engine/source/windowManager/sdl/sdlWindow.h
Implementation of a window on SDL.
Active window list
Items used to track window instances.
Which manager created us?
Which window comes next in list?
Window Information
SDL_Window *
Our SDL window.
SDL_Window *
Our former Parent.
Reference to the render target allocated on this window.
Our current size/resolution/fullscreen status.
bool
Is the mouse locked to this window?
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.
void *
Menu associated with this window. This is a passive property of the window and is not required to be used at all.
bool
Indicates if the window is being closed. This allows us to safely ignore other events like focus being gained or losed after cleanup has begun.
Public Friends
class
Private Functions
_processSDLEvent(SDL_Event & evt)
_triggerKeyNotify(const SDL_Event & event)
_triggerMouseButtonNotify(const SDL_Event & event)
_triggerMouseLocationNotify(const SDL_Event & evt)
_triggerMouseWheelNotify(const SDL_Event & event)
_triggerTextNotify(const SDL_Event & event)
_updateMonitorFromMove(const SDL_Event & event)
Public Functions
_setFullscreen(const bool fullscreen)
_setVideoMode(const GFXVideoMode & mode)
bool
If we're fullscreen, this function returns us to desktop mode.
clientToScreen(const Point2I & point)
Convert the coordinate given in this window space to screen coordinates.
Provide a simple GDI-based render for when the game is not rendering.
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.
void *&
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.
SDL_Window *
void *
getSystemWindow(const WindowSystem system)
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.
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
isOpen()
Returns true if the window is instantiated in the OS.
bool
Returns true if the window is visible.
screenToClient(const Point2I & point)
Convert the given screen coordinates to coordinates in this window space.
bool
setCaption(const char * cap)
Set the window's caption.
setClientExtent(const Point2I newExtent)
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.
setKeyboardTranslation(const bool enabled)
Set if relevant keypress events should be translated into character input events.
setMenuHandle(void * 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
bool
Should the mouse be locked at the next opportunity ?
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 SDL.
Active window list
Items used to track window instances.
PlatformWindowManagerSDL * mOwningManager
Which manager created us?
PlatformWindowSDL * mNextWindow
Which window comes next in list?
Window Information
SDL_Window * mWindowHandle
Our SDL window.
SDL_Window * mOldParent
Our former Parent.
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.
bool mMouseLocked
Is the mouse locked to this window?
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.
void * mMenuHandle
Menu associated with this window. This is a passive property of the window and is not required to be used at all.
bool mClosing
Indicates if the window is being closed. This allows us to safely ignore other events like focus being gained or losed after cleanup has begun.
Public Friends
Private Functions
_processSDLEvent(SDL_Event & evt)
_triggerKeyNotify(const SDL_Event & event)
_triggerMouseButtonNotify(const SDL_Event & event)
_triggerMouseLocationNotify(const SDL_Event & evt)
_triggerMouseWheelNotify(const SDL_Event & event)
_triggerTextNotify(const SDL_Event & event)
_updateMonitorFromMove(const SDL_Event & event)
Public Functions
PlatformWindowSDL()
~PlatformWindowSDL()
_setFullscreen(const bool fullscreen)
Reimplemented from: PlatformWindow
_setVideoMode(const GFXVideoMode & mode)
Reimplemented from: PlatformWindow
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
getMenuHandle()
getNextWindow()
Reimplemented from: PlatformWindow
getPlatformDrawable()
Reimplemented from: PlatformWindow
getPosition()
Reimplemented from: PlatformWindow
getSDLWindow()
getSystemWindow(const WindowSystem system)
Reimplemented from: PlatformWindow
getVideoMode()
Reimplemented from: PlatformWindow
getWindowId()
Reimplemented from: PlatformWindow
hide()
Reimplemented from: PlatformWindow
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
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
setKeyboardTranslation(const bool enabled)
Reimplemented from: PlatformWindow
setMenuHandle(void * 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
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.