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 () | |
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. | |
Boolean | 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 | DestroyViewport (Viewport *ToBeDestroyed) |
Destroys a viewport within this window. More... | |
void | EnableVsync (bool 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. | |
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 current level of Anti-Aliasing enabled on this Window. More... | |
bool | GetFullscreen () const |
Gets the Fullscreen Setting. 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... | |
Whole | GetRenderHeight () const |
Gets the Height of the Rendering Area. More... | |
Whole | GetRenderWidth () const |
Gets the Width of the Rendering Area. 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... | |
const String & | GetWindowCaption () |
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... | |
Boolean | IsBorderless () const |
Gets whether this window is borderless. More... | |
Boolean | IsHidden () const |
Gets whether this window is hidden. 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 | SetFullscreen (const bool Fullscreen) |
Set the Fullscreen Setting. More... | |
void | SetHidden (bool Hidden) |
Hides (shows) the window. More... | |
void | SetRenderHeight (const Whole &Height) |
Sets the Height. More... | |
void | SetRenderOptions (const WindowSettings &NewSettings) |
Changes the X Resolution, Y Resolution, and fullscreen at the same time. More... | |
void | SetRenderResolution (const Whole &Width, const Whole &Height) |
Changes the X and Y Resolution at the same time. More... | |
void | SetRenderWidth (const Whole &Width) |
Sets the Width. More... | |
Boolean | VsyncEnabled () const |
Gets whether or not vsync is currently enabled on this window. More... | |
Protected Member Functions | |
void | CreateGameWindow (const String &WindowCaption, const Whole Width, const Whole Height, const Whole Flags) |
Convenience method for constructing a window. More... | |
int | IsLargerThenDesktop (const Whole Width, const Whole Height) |
Checks to see if a resolution is larger than the currently set desktop resolution. 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... | |
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 62 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 72 of file gamewindow.cpp.
Ogre::RenderWindow * Mezzanine::Graphics::GameWindow::_GetOgreWindowPointer | ( | ) |
This will get a pointer to the Ogre RenderWindow.
Definition at line 434 of file gamewindow.cpp.
SDL_Window * Mezzanine::Graphics::GameWindow::_GetSDLWindowPointer | ( | ) |
This will get a pointer to the SDL Window.
Definition at line 437 of file gamewindow.cpp.
Boolean Mezzanine::Graphics::GameWindow::BorderIsResizeable | ( | ) | const |
Gets whether or not this window has a resizeable border.
Definition at line 404 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 92 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 188 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 230 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::EnableVsync | ( | bool | Enable) |
Enables (or disables) vsync on this window.
Enable | Whether or not to enable vsync. |
Definition at line 392 of file gamewindow.cpp.
Real Mezzanine::Graphics::GameWindow::GetAverageFPS | ( | ) | const |
Gets the Average FPS.
Definition at line 416 of file gamewindow.cpp.
Real Mezzanine::Graphics::GameWindow::GetBestFPS | ( | ) | const |
Gets the Best FPS.
Definition at line 419 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 425 of file gamewindow.cpp.
Whole Mezzanine::Graphics::GameWindow::GetFSAALevel | ( | ) | const |
Gets the current level of Anti-Aliasing enabled on this Window.
Definition at line 389 of file gamewindow.cpp.
bool Mezzanine::Graphics::GameWindow::GetFullscreen | ( | ) | const |
Gets the Fullscreen Setting.
Gets the Fullscreen Setting
Definition at line 367 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 413 of file gamewindow.cpp.
Whole Mezzanine::Graphics::GameWindow::GetNumViewports | ( | ) | const |
Gets the number of viewports within this window.
Definition at line 225 of file gamewindow.cpp.
Whole Mezzanine::Graphics::GameWindow::GetRenderHeight | ( | ) | const |
Gets the Height of the Rendering Area.
Gets the Height of the Rendering Area
Definition at line 290 of file gamewindow.cpp.
Whole Mezzanine::Graphics::GameWindow::GetRenderWidth | ( | ) | const |
Gets the Width of the Rendering Area.
Gets the Width of the Rendering Area
Definition at line 277 of file gamewindow.cpp.
const WindowSettings & Mezzanine::Graphics::GameWindow::GetSettings | ( | ) |
Gets the current window settings.
Returns | a WindowSettings struct with the current window settings. |
Definition at line 378 of file gamewindow.cpp.
Gets a viewport by index.
Index | The index of the Viewport to retrieve. |
Definition at line 204 of file gamewindow.cpp.
Gets a viewport by ZOrder.
ZOrder | The ZOrder of the Viewport to retrieve. |
Definition at line 214 of file gamewindow.cpp.
const String & Mezzanine::Graphics::GameWindow::GetWindowCaption | ( | ) |
Gets the the text in the titlebar.
Definition at line 386 of file gamewindow.cpp.
Real Mezzanine::Graphics::GameWindow::GetWorstFPS | ( | ) | const |
Gets the Worst FPS.
Definition at line 422 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 428 of file gamewindow.cpp.
Boolean Mezzanine::Graphics::GameWindow::IsBorderless | ( | ) | const |
Gets whether this window is borderless.
Definition at line 407 of file gamewindow.cpp.
Boolean Mezzanine::Graphics::GameWindow::IsHidden | ( | ) | const |
Gets whether this window is hidden.
Definition at line 401 of file gamewindow.cpp.
|
protected |
Checks to see if a resolution is larger than the currently set desktop resolution.
Width | The number of horizontal pixels to check against the desktop. |
Height | The number of vertical pixels to check against the desktop. |
Definition at line 173 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetFullscreen | ( | const bool | Fullscreen) |
Set the Fullscreen Setting.
Set the Fullscreen Setting
Fullscreen | This accepts a bool. True for fullscreen, false for windowed |
Definition at line 333 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetHidden | ( | bool | Hidden) |
Hides (shows) the window.
Hidden | Whether or not to hide the window. |
Definition at line 398 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetRenderHeight | ( | const Whole & | Height) |
Sets the Height.
Set the Render Height inside the window in windowed mode, set the resolution of the screen in fullscreen
Height | This accepts a Whole. |
Definition at line 282 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetRenderOptions | ( | const WindowSettings & | NewSettings) |
Changes the X Resolution, Y Resolution, and fullscreen at the same time.
This should be useful in situations where it is not possible to update all of the options separately.
Definition at line 372 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetRenderResolution | ( | const Whole & | Width, |
const Whole & | Height | ||
) |
Changes the X and Y Resolution at the same time.
This should be useful in situations where it is not possible to update the width and height separately.
Width | The new desired Width for the rendering area as a whole number |
Height | The new desired Width for the rendering area as a whole number |
Definition at line 295 of file gamewindow.cpp.
void Mezzanine::Graphics::GameWindow::SetRenderWidth | ( | const Whole & | Width) |
Sets the Width.
Set the Render Width inside the window in windowed mode, set the resolution of the screen in fullscreen
Width | This accepts a Whole. |
Definition at line 269 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 163 of file gamewindow.cpp.
Boolean Mezzanine::Graphics::GameWindow::VsyncEnabled | ( | ) | const |
Gets whether or not vsync is currently enabled on this window.
Definition at line 395 of file gamewindow.cpp.
|
protected |
A bit field containing all the flags used in the construction of this GameWindow.
Definition at line 109 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 |
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.