MezzanineEngine March 18, 2012

Mezzanine::GraphicsManager Class Reference

This is intended to store basic graphics setting for the user. More...

#include <graphicsmanager.h>

Inheritance diagram for Mezzanine::GraphicsManager:
Mezzanine::ManagerBase Mezzanine::Singleton< GraphicsManager >

List of all members.

Public Member Functions

 GraphicsManager ()
 Basic constructor.
 GraphicsManager (const Whole &Width, const Whole &Height, const bool &FullScreen)
 Versatile Constructor.
 ~GraphicsManager ()
 Class Destructor.
GameWindowCreateGameWindow (const String &WindowCaption, const Whole &Width, const Whole &Height, const Whole &Flags)
 Creates a new game window to be rendered to.
void DestroyAllGameWindows (bool ExcludePrimary=true)
 Destroys every game window created.
void DestroyGameWindow (GameWindow *ToBeDestroyed)
 Destroys a created game window by index.
virtual void DoMainLoopItems ()
 This is where the rendering takes place.
Mezzanine::RenderSystem GetCurrRenderSystem ()
 Gets the current rendersystem being used.
const GraphicsSettingsGetDefaultSettings ()
 Gets the default settings for windows this manager initialized with.
const GraphicsSettingsGetDesktopSettings ()
 Gets the desktop display settings.
GameWindowGetGameWindow (const Whole &Index)
 Gets a game window by index.
Whole GetNumGameWindows ()
 Gets the number of game windows within this manager.
GameWindowGetPrimaryGameWindow ()
 Gets the primary(first) game window.
String GetRenderSystemName ()
 Gets the name of the render system in current use.
const std::vector< String > * GetSupportedDevices ()
 Gets a vector containing all the devices supported by this render system on the current hardware.
const std::vector< String > * GetSupportedResolutions ()
 Gets a vector containing all the resolutions supported by this render system on the current hardware.
virtual ManagerTypeName GetType () const
 This returns the type of this manager.
bool HasOgreBeenInitialized ()
 Gets whether or not Ogre has been started.
bool HasSDLBeenInitialized ()
 Gets whether or not SDL has been started.
virtual void Initialize ()
 Empty Initializor.
virtual bool PostMainLoopItems ()
 This is derived from and uses the ManagerBase to perform the the post main loop callbacks.
virtual void RenderOneFrame ()
 Renders one frame of the scene.
virtual void ResetRenderTimer ()
 Resets the Render timer.
void SetRenderSystem (const Mezzanine::RenderSystem &RenderSys)
 Sets the render system to be used.
virtual void SwapAllBuffers (bool WaitForVsync)
 Swaps all the buffers of all GameWindows.

Static Public Member Functions

static void InitSDL ()
 SDL is used for use input, and must be initialized prior to use.

Detailed Description

This is intended to store basic graphics setting for the user.

This stores x/y resolution, fullscreen and in the future other settings. This is intended to make it easy for developers to pass/move around complex graphics settings. We hope to eventually include other items like shader settings, rendering API, and maybe other settings too.

Definition at line 76 of file graphicsmanager.h.


Constructor & Destructor Documentation

Mezzanine::GraphicsManager::GraphicsManager ( )

Basic constructor.

This creates a basic Graphics Settings with resolution 640x480 with fullscreen set to false

Definition at line 71 of file graphicsmanager.cpp.

Mezzanine::GraphicsManager::GraphicsManager ( const Whole Width,
const Whole Height,
const bool &  FullScreen 
)

Versatile Constructor.

Parameters:
WidthThe desired width.
HeightThe desired height.
FullScreenTrue if fullscreen, false if not.

This creates a Graphics Settings with resolution and fullscreen passed into to it that will be used when creating the primary window if one isn't already created when this manager in initialized. Be careful that the settings selected are appropriate. Many mobile devices do not support windows, and many screens do not support arbitrary resolutions in fullscreen mode.

Definition at line 78 of file graphicsmanager.cpp.


Member Function Documentation

GameWindow * Mezzanine::GraphicsManager::CreateGameWindow ( const String WindowCaption,
const Whole Width,
const Whole Height,
const Whole Flags 
)

Creates a new game window to be rendered to.

Parameters:
WindowCaptionThe caption to be set in the window titlebar.
WidthThe desired width in pixels.
HeightThe desired height in pixels.
FlagsAdditional misc parameters, see GameWindow class for more info.

Definition at line 192 of file graphicsmanager.cpp.

void Mezzanine::GraphicsManager::DestroyAllGameWindows ( bool  ExcludePrimary = true)

Destroys every game window created.

Parameters:
ExcludePrimaryWhether or not you want to spare the primary window created.

Definition at line 231 of file graphicsmanager.cpp.

void Mezzanine::GraphicsManager::DestroyGameWindow ( GameWindow ToBeDestroyed)

Destroys a created game window by index.

Parameters:
WindowIndexThe index of the window to be destroyed.

Definition at line 218 of file graphicsmanager.cpp.

void Mezzanine::GraphicsManager::DoMainLoopItems ( ) [virtual]

This is where the rendering takes place.

This does the rendering for the game using all the actors in the actormanager.

Implements Mezzanine::ManagerBase.

Definition at line 356 of file graphicsmanager.cpp.

Mezzanine::RenderSystem Mezzanine::GraphicsManager::GetCurrRenderSystem ( )

Gets the current rendersystem being used.

Remarks:
This does not return a pointer or any other kind of accessor to the actual rendersystem structure. If you need that, then we're doing something wrong.
Returns:
Returns an enum value coresponding to the render system being used.

Definition at line 275 of file graphicsmanager.cpp.

const GraphicsSettings & Mezzanine::GraphicsManager::GetDefaultSettings ( )

Gets the default settings for windows this manager initialized with.

Parameters:
Returnsa GraphicsSettings struct with the default display settings.

Definition at line 254 of file graphicsmanager.cpp.

const GraphicsSettings & Mezzanine::GraphicsManager::GetDesktopSettings ( )

Gets the desktop display settings.

Parameters:
Returnsa GraphicsSettings struct with the desktop display settings.

Definition at line 249 of file graphicsmanager.cpp.

GameWindow * Mezzanine::GraphicsManager::GetGameWindow ( const Whole Index)

Gets a game window by index.

Returns:
Returns a pointer to the game window requested.

Definition at line 208 of file graphicsmanager.cpp.

Whole Mezzanine::GraphicsManager::GetNumGameWindows ( )

Gets the number of game windows within this manager.

Returns:
Returns a Whole representing the number of game windows within this manager.

Definition at line 213 of file graphicsmanager.cpp.

GameWindow * Mezzanine::GraphicsManager::GetPrimaryGameWindow ( )

Gets the primary(first) game window.

Returns:
Returns a pointer to the primary game window.

Definition at line 244 of file graphicsmanager.cpp.

String Mezzanine::GraphicsManager::GetRenderSystemName ( )

Gets the name of the render system in current use.

Returns:
Returns a string containing the name of the current render system.

Definition at line 280 of file graphicsmanager.cpp.

const std::vector< String > * Mezzanine::GraphicsManager::GetSupportedDevices ( )

Gets a vector containing all the devices supported by this render system on the current hardware.

This vector is populated when the manager gets initialized. Calling on it before then will give you an empty vector.

Returns:
Returns a Const Pointer to the vector storing all the supported devices.

Definition at line 293 of file graphicsmanager.cpp.

const std::vector< String > * Mezzanine::GraphicsManager::GetSupportedResolutions ( )

Gets a vector containing all the resolutions supported by this render system on the current hardware.

This vector is populated when the manager gets initialized. Calling on it before then will give you an empty vector.

Returns:
Returns a Const Pointer to the vector storing all the supported resolutions.

Definition at line 288 of file graphicsmanager.cpp.

ManagerBase::ManagerTypeName Mezzanine::GraphicsManager::GetType ( ) const [virtual]

This returns the type of this manager.

Returns:
This returns ManagerTypeName::GraphicsManager

Implements Mezzanine::ManagerBase.

Definition at line 378 of file graphicsmanager.cpp.

bool Mezzanine::GraphicsManager::HasOgreBeenInitialized ( )

Gets whether or not Ogre has been started.

Returns:
Returns a bool indicating whether or not Ogre has been initialized yet.

Definition at line 264 of file graphicsmanager.cpp.

bool Mezzanine::GraphicsManager::HasSDLBeenInitialized ( )

Gets whether or not SDL has been started.

Returns:
Returns a bool indicating whether or not SDL has been initialized yet.

Definition at line 259 of file graphicsmanager.cpp.

void Mezzanine::GraphicsManager::Initialize ( ) [virtual]

Empty Initializor.

This specific initializor is unneeded, but we implement it for compatibility. It also exists in case a derived class wants to override it for some reason

Implements Mezzanine::ManagerBase.

Definition at line 324 of file graphicsmanager.cpp.

bool Mezzanine::GraphicsManager::PostMainLoopItems ( ) [virtual]

This is derived from and uses the ManagerBase to perform the the post main loop callbacks.

Returns:
This returns a true or false depending on what the callback returns

Reimplemented from Mezzanine::ManagerBase.

Definition at line 381 of file graphicsmanager.cpp.

void Mezzanine::GraphicsManager::ResetRenderTimer ( ) [virtual]

Resets the Render timer.

This function should not be called unless you know exactly what you are doing. This will reset the timer keeping track of game frame times, and thus can disrupt functionality of the mainloop.

Definition at line 298 of file graphicsmanager.cpp.

void Mezzanine::GraphicsManager::SetRenderSystem ( const Mezzanine::RenderSystem RenderSys)

Sets the render system to be used.

Remarks:
This will only work prior to a window being created/graphics manager being initialized. The internal structures to be built need to know what rendersystem to build for. Additionally this cannot be swapped/changed at runtime. If called after a window has been made this will throw an exception.
Parameters:
RenderSysThe Render system to be used.

Definition at line 269 of file graphicsmanager.cpp.

void Mezzanine::GraphicsManager::SwapAllBuffers ( bool  WaitForVsync) [virtual]

Swaps all the buffers of all GameWindows.

Parameters:
WaitForVsyncWhether or not the buffer should swap after the vsync interval is completed.

Definition at line 317 of file graphicsmanager.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines