This class is for creating and managing game windows. More...
#include <gamewindow.h>
Public Types | |
typedef ViewportContainer::const_reverse_iterator | ConstReverseViewportIterator |
Const Reverse Iterator type for Viewport instances stored by this class. | |
typedef ViewportContainer::const_iterator | ConstViewportIterator |
Const Iterator type for Viewport instances stored by this class. | |
typedef ViewportContainer::reverse_iterator | ReverseViewportIterator |
Reverse Iterator type for Viewport instances stored by this class. | |
typedef std::list< Viewport * > | ViewportContainer |
Basic container type for Viewport storage by this class. | |
typedef ViewportContainer::iterator | ViewportIterator |
Iterator type for Viewport instances stored by this class. | |
enum | WindowFlags { WF_Fullscreen = 1, WF_Hidden = 2, WF_VsyncEnabled = 4, WF_FSAA_2 = 8, WF_FSAA_4 = 16, WF_FSAA_8 = 32, WF_FSAA_16 = 64, WF_Resizeable = 128, WF_Maximized = 256, WF_Borderless = 512 } |
A listing of potential options for configuring a game window during construction. More... | |
Public Member Functions | |
GameWindow (const String &WindowCaption, const Whole Width, const Whole Height, const Whole Flags) | |
Class constructor. More... | |
GameWindow (const XML::Node &XMLNode) | |
XML constructor. More... | |
~GameWindow () | |
Class destructor. | |
Ogre::RenderWindow * | _GetOgreWindowPointer () |
This will get a pointer to the Ogre RenderWindow. More... | |
SDL_Window * | _GetSDLWindowPointer () |
This will get a pointer to the SDL Window. More... | |
ViewportIterator | BeginViewport () |
Gets an iterator to the first viewport in this window. | |
ConstViewportIterator | BeginViewport () const |
Gets a const iterator to the first viewport in this window. | |
Boole | BorderIsResizeable () const |
Gets whether or not this window has a resizeable border. More... | |
Viewport * | CreateViewport (CameraProxy *ViewportCamera, const Integer ZOrder) |
Creates an additional Viewport within a created render window. More... | |
void | DestroyAllViewports () |
Destroys every viewport within this window. | |
void | DestroyViewport (Viewport *ToBeDestroyed) |
Destroys a viewport within this window. More... | |
void | EnableVsync (Boole Enable) |
Enables (or disables) vsync on this window. More... | |
ViewportIterator | EndViewport () |
Gets an iterator to one passed the last viewport in this window. | |
ConstViewportIterator | EndViewport () const |
Gets a const iterator to one passed the last viewport in this window. | |
Whole | GetActualFSAALevel () const |
Gets the actual Anti-Aliasing level currently being used by this game window. More... | |
Real | GetAverageFPS () const |
Gets the Average FPS. More... | |
Real | GetBestFPS () const |
Gets the Best FPS. More... | |
Real | GetBestFrameTime () const |
Gets the shortest amount of time it's taken to render a frame. More... | |
Whole | GetFSAALevel () const |
Gets the last set Anti-Aliasing level on this Window. More... | |
Boole | GetFullscreen () const |
Gets the Fullscreen Setting. More... | |
Whole | GetHeight () const |
Gets the height of the game window. More... | |
Real | GetLastFPS () const |
Gets the FPS based on the last frame rendered. More... | |
Whole | GetNumViewports () const |
Gets the number of viewports within this window. More... | |
const Resolution & | GetResolution () const |
Gets the width and height of the game window. More... | |
const WindowSettings & | GetSettings () |
Gets the current window settings. More... | |
Viewport * | GetViewport (const Whole Index) const |
Gets a viewport by index. More... | |
Viewport * | GetViewportByZOrder (const Integer ZOrder) const |
Gets a viewport by ZOrder. More... | |
Whole | GetWidth () const |
Gets the Width of the game window. More... | |
const String & | GetWindowCaption () const |
Gets the the text in the titlebar. More... | |
Real | GetWorstFPS () const |
Gets the Worst FPS. More... | |
Real | GetWorstFrameTime () const |
Gets the longest amount of time it's taken to render a frame. More... | |
Boole | IsBorderless () const |
Gets whether this window is borderless. More... | |
Boole | IsHidden () const |
Gets whether this window is hidden. More... | |
void | ProtoDeSerialize (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite this object with it. More... | |
void | ProtoDeSerializeProperties (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite the properties of this object with it. More... | |
void | ProtoDeSerializeViewports (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite the viewports of this object with it. More... | |
void | ProtoSerialize (XML::Node &ParentNode) const |
Convert this class to an XML::Node ready for serialization. More... | |
void | ProtoSerializeProperties (XML::Node &SelfRoot) const |
Convert the properties of this class to an XML::Node ready for serialization. More... | |
void | ProtoSerializeViewports (XML::Node &SelfRoot) const |
Convert the viewports of this class to an XML::Node ready for serialization. More... | |
ReverseViewportIterator | ReverseBeginViewport () |
Gets an iterator to the last viewport in this window. | |
ConstReverseViewportIterator | ReverseBeginViewport () const |
Gets a const iterator to the last viewport in this window. | |
ReverseViewportIterator | ReverseEndViewport () |
Gets an iterator to one before the first viewport in this window. | |
ConstReverseViewportIterator | ReverseEndViewport () const |
Gets a const iterator to one before the first viewport in this window. | |
void | SetFSAALevel (const Whole FSAA) |
Sets the level of Full Scale Anti-Aliasing to be used when rendering to this window. More... | |
void | SetFullscreen (const Boole Fullscreen) |
Set the Fullscreen Setting. More... | |
void | SetHeight (const Whole &Height) |
Sets the height of the game window. More... | |
void | SetHidden (Boole Hidden) |
Hides (shows) the window. More... | |
void | SetRenderOptions (const WindowSettings &NewSettings) |
Changes the X Resolution, Y Resolution, and fullscreen at the same time. More... | |
void | SetResolution (const Resolution &WinRes) |
Sets the width and height of the game window. More... | |
void | SetResolution (const Whole &Width, const Whole &Height) |
Sets the width and height of the game window. More... | |
void | SetWidth (const Whole &Width) |
Sets the width of the game window. More... | |
Boole | VsyncEnabled () const |
Gets whether or not vsync is currently enabled on this window. More... | |
Static Public Member Functions | |
static String | GetSerializableName () |
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized. More... | |
Protected Member Functions | |
void | AddViewport (Viewport *NewVP) |
Inserts a Viewport into this window based on it's ZOrder. More... | |
void | CreateGameWindow (const String &WindowCaption, const Whole Width, const Whole Height, const Whole Flags) |
Convenience method for constructing a window. More... | |
void | UpdateViewportsAndCameras () |
Updates all the viewports of this window and the cameras attached to them after a change in window geometry. More... | |
Protected Attributes | |
Whole | CreationFlags |
A bit field containing all the flags used in the construction of this GameWindow. More... | |
GraphicsManager * | Manager |
A pointer to the manager that created this window. More... | |
Ogre::RenderWindow * | OgreWindow |
A pointer to the internal window used for rendering. More... | |
Whole | RequestedFSAA |
The last set FSAA level for this gamewindow (used for serialization). More... | |
SDL_Window * | SDLWindow |
A pointer to the internal window used for collecting input. More... | |
WindowSettings | Settings |
A struct storing all the window dimensions and update settings. More... | |
ViewportContainer | Viewports |
A container storing all the viewports belonging to this window. More... | |
This class is for creating and managing game windows.
Definition at line 63 of file gamewindow.h.
A listing of potential options for configuring a game window during construction.
Definition at line 78 of file gamewindow.h.
Mezzanine::Graphics::GameWindow::GameWindow | ( | const String & | WindowCaption, |
const Whole | Width, | ||
const Whole | Height, | ||
const Whole | Flags | ||
) |
Class constructor.
WindowCaption | The caption to be set in the window titlebar. |
Width | The desired width in pixels. |
Height | The desired height in pixels. |
Flags | Additional misc parameters, see WindowFlags enum for more info. |
Definition at line 75 of file gamewindow.cpp.
Mezzanine::Graphics::GameWindow::GameWindow | ( | const XML::Node & | XMLNode | ) |
XML constructor.
XMLNode | The node of the xml document to construct from. |
Definition at line 82 of file gamewindow.cpp.
Ogre::RenderWindow * Mezzanine::Graphics::GameWindow::_GetOgreWindowPointer | ( | ) |
This will get a pointer to the Ogre RenderWindow.
Definition at line 580 of file gamewindow.cpp.
SDL_Window * Mezzanine::Graphics::GameWindow::_GetSDLWindowPointer | ( | ) |
This will get a pointer to the SDL Window.
Definition at line 583 of file gamewindow.cpp.
|
protected |
Inserts a Viewport into this window based on it's ZOrder.
NewVP | A pointer to the Viewport being added to this window. |
Definition at line 176 of file gamewindow.cpp.
Boole Mezzanine::Graphics::GameWindow::BorderIsResizeable | ( | ) | const |
Gets whether or not this window has a resizeable border.
Definition at line 403 of file gamewindow.cpp.
|
protected |
Convenience method for constructing a window.
WindowCaption | The caption to be set in the window titlebar. |
Width | The desired width in pixels. |
Height | The desired height in pixels. |
Flags | Additional misc parameters, see WindowFlags enum for more info. |
Definition at line 105 of file gamewindow.cpp.
Viewport * Mezzanine::Graphics::GameWindow::CreateViewport | ( | CameraProxy * | ViewportCamera, |
const Integer | ZOrder | ||
) |
Creates an additional Viewport within a created render window.
VeiwportCamera | The camera that is to be attached to this Viewport. |
ZOrder | The render order of this viewport relative to other viewports in this window. |
Definition at line 201 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::DestroyViewport | ( | Viewport * | ToBeDestroyed | ) |
Destroys a viewport within this window.
ToBeDestroyed | The viewport that will be destroyed. |
Definition at line 234 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::EnableVsync | ( | Boole | Enable | ) |
Enables (or disables) vsync on this window.
Enable | Whether or not to enable vsync. |
Definition at line 391 of file gamewindow.cpp.
Whole Mezzanine::Graphics::GameWindow::GetActualFSAALevel | ( | ) | const |
Gets the actual Anti-Aliasing level currently being used by this game window.
Definition at line 388 of file gamewindow.cpp.
Real Mezzanine::Graphics::GameWindow::GetAverageFPS | ( | ) | const |
Gets the Average FPS.
Definition at line 415 of file gamewindow.cpp.
Real Mezzanine::Graphics::GameWindow::GetBestFPS | ( | ) | const |
Gets the Best FPS.
Definition at line 418 of file gamewindow.cpp.
Real Mezzanine::Graphics::GameWindow::GetBestFrameTime | ( | ) | const |
Gets the shortest amount of time it's taken to render a frame.
Definition at line 424 of file gamewindow.cpp.
Whole Mezzanine::Graphics::GameWindow::GetFSAALevel | ( | ) | const |
Gets the last set Anti-Aliasing level on this Window.
Definition at line 385 of file gamewindow.cpp.
Boole Mezzanine::Graphics::GameWindow::GetFullscreen | ( | ) | const |
Gets the Fullscreen Setting.
Definition at line 360 of file gamewindow.cpp.
Whole Mezzanine::Graphics::GameWindow::GetHeight | ( | ) | const |
Gets the height of the game window.
Definition at line 291 of file gamewindow.cpp.
Real Mezzanine::Graphics::GameWindow::GetLastFPS | ( | ) | const |
Gets the FPS based on the last frame rendered.
This essentially determines how many frames could be rendered if all frames within a second rendered at the same speed.
Definition at line 412 of file gamewindow.cpp.
Whole Mezzanine::Graphics::GameWindow::GetNumViewports | ( | ) | const |
Gets the number of viewports within this window.
Definition at line 229 of file gamewindow.cpp.
const Resolution & Mezzanine::Graphics::GameWindow::GetResolution | ( | ) | const |
Gets the width and height of the game window.
Definition at line 322 of file gamewindow.cpp.
|
static |
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized.
Definition at line 574 of file gamewindow.cpp.
const WindowSettings & Mezzanine::Graphics::GameWindow::GetSettings | ( | ) |
Gets the current window settings.
Definition at line 371 of file gamewindow.cpp.
Gets a viewport by index.
Index | The index of the Viewport to retrieve. |
Definition at line 208 of file gamewindow.cpp.
Gets a viewport by ZOrder.
ZOrder | The ZOrder of the Viewport to retrieve. |
Definition at line 218 of file gamewindow.cpp.
Whole Mezzanine::Graphics::GameWindow::GetWidth | ( | ) | const |
Gets the Width of the game window.
Definition at line 285 of file gamewindow.cpp.
const String & Mezzanine::Graphics::GameWindow::GetWindowCaption | ( | ) | const |
Gets the the text in the titlebar.
Definition at line 379 of file gamewindow.cpp.
Real Mezzanine::Graphics::GameWindow::GetWorstFPS | ( | ) | const |
Gets the Worst FPS.
Definition at line 421 of file gamewindow.cpp.
Real Mezzanine::Graphics::GameWindow::GetWorstFrameTime | ( | ) | const |
Gets the longest amount of time it's taken to render a frame.
Definition at line 427 of file gamewindow.cpp.
Boole Mezzanine::Graphics::GameWindow::IsBorderless | ( | ) | const |
Gets whether this window is borderless.
Definition at line 406 of file gamewindow.cpp.
Boole Mezzanine::Graphics::GameWindow::IsHidden | ( | ) | const |
Gets whether this window is hidden.
Definition at line 400 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::ProtoDeSerialize | ( | const XML::Node & | SelfRoot | ) |
Take the data stored in an XML Node and overwrite this object with it.
SelfRoot | An XML::Node containing the data to populate this class with. |
Definition at line 477 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::ProtoDeSerializeProperties | ( | const XML::Node & | SelfRoot | ) |
Take the data stored in an XML Node and overwrite the properties of this object with it.
SelfRoot | An XML::Node containing the data to populate this class with. |
Definition at line 483 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::ProtoDeSerializeViewports | ( | const XML::Node & | SelfRoot | ) |
Take the data stored in an XML Node and overwrite the viewports of this object with it.
SelfRoot | An XML::Node containing the data to populate this class with. |
Definition at line 554 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::ProtoSerialize | ( | XML::Node & | ParentNode | ) | const |
Convert this class to an XML::Node ready for serialization.
ParentNode | The point in the XML hierarchy that all this GameWindow should be appended to. |
Definition at line 433 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::ProtoSerializeProperties | ( | XML::Node & | SelfRoot | ) | const |
Convert the properties of this class to an XML::Node ready for serialization.
SelfRoot | The root node containing all the serialized data for this instance. |
Definition at line 441 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::ProtoSerializeViewports | ( | XML::Node & | SelfRoot | ) | const |
Convert the viewports of this class to an XML::Node ready for serialization.
SelfRoot | The root node containing all the serialized data for this instance. |
Definition at line 464 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetFSAALevel | ( | const Whole | FSAA | ) |
Sets the level of Full Scale Anti-Aliasing to be used when rendering to this window.
FSAA | The Anti-Aliasing level to be used, generally one of these values: 0, 2, 4, 8, or 16. |
Definition at line 382 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetFullscreen | ( | const Boole | Fullscreen | ) |
Set the Fullscreen Setting.
Fullscreen | This accepts a Boole. True for fullscreen, false for windowed. |
Definition at line 327 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetHeight | ( | const Whole & | Height | ) |
Sets the height of the game window.
Height | The pixel size of the game window on the Y axis. |
Definition at line 288 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetHidden | ( | Boole | Hidden | ) |
Hides (shows) the window.
Hidden | Whether or not to hide the window. |
Definition at line 397 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetRenderOptions | ( | const WindowSettings & | NewSettings | ) |
Changes the X Resolution, Y Resolution, and fullscreen at the same time.
NewSettings | A WindowSettings struct containing all of the window settings to be applied. |
Definition at line 365 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetResolution | ( | const Resolution & | WinRes | ) |
Sets the width and height of the game window.
WinRes | A Resolution containing the width and height to be applied. |
Definition at line 294 of file gamewindow.cpp.
Sets the width and height of the game window.
Width | The pixel size of the game window on the X axis. |
Height | The pixel size of the game window on the Y axis. |
Definition at line 297 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetWidth | ( | const Whole & | Width | ) |
Sets the width of the game window.
Width | The pixel size of the game window on the X axis. |
Definition at line 282 of file gamewindow.cpp.
|
protected |
Updates all the viewports of this window and the cameras attached to them after a change in window geometry.
Definition at line 188 of file gamewindow.cpp.
Boole Mezzanine::Graphics::GameWindow::VsyncEnabled | ( | ) | const |
Gets whether or not vsync is currently enabled on this window.
Definition at line 394 of file gamewindow.cpp.
|
protected |
A bit field containing all the flags used in the construction of this GameWindow.
Definition at line 112 of file gamewindow.h.
|
protected |
A pointer to the manager that created this window.
Definition at line 100 of file gamewindow.h.
|
protected |
A pointer to the internal window used for rendering.
Definition at line 103 of file gamewindow.h.
|
protected |
The last set FSAA level for this gamewindow (used for serialization).
Definition at line 109 of file gamewindow.h.
|
protected |
A pointer to the internal window used for collecting input.
Definition at line 106 of file gamewindow.h.
|
protected |
A struct storing all the window dimensions and update settings.
Definition at line 94 of file gamewindow.h.
|
protected |
A container storing all the viewports belonging to this window.
Definition at line 97 of file gamewindow.h.