This is intended to store basic graphics setting for the user. More...
#include <graphicsmanager.h>
Public Types | |
typedef GameWindowContainer::const_iterator | ConstGameWindowIterator |
Const Iterator type for GameWindow instances stored by this class. | |
typedef std::vector< GameWindow * > | GameWindowContainer |
Basic container type for GameWindow storage by this class. | |
typedef GameWindowContainer::iterator | GameWindowIterator |
Iterator type for GameWindow instances stored by this class. | |
typedef std::vector < Ogre::Plugin * > | InternalPluginContainer |
Basic container type for internal plugin storage by this class. | |
typedef std::vector< RenderSystem > | RenderSystemTypeContainer |
Basic container type for registered rendersystem type storage by this class. | |
Public Types inherited from Mezzanine::ManagerBase | |
enum | ManagerType { MT_AudioManager = 1, MT_AnimationManager, MT_CollisionShapeManager, MT_CompositorManager, MT_GraphicsManager, MT_EventManager, MT_InputManager, MT_LogManager, MT_MaterialManager, MT_MeshManager, MT_NetworkManager, MT_ResourceManager, MT_ScriptingManager, MT_UIManager, MT_ActorManager = 100, MT_AreaEffectManager, MT_CameraManager, MT_DebrisManager, MT_PagingManager, MT_PhysicsManager, MT_SceneManager, MT_SoundScapeManager, MT_TerrainManager, MT_VehicleManager, MT_UserCreated = 512 } |
Public Types inherited from Mezzanine::ObjectSettingsHandler | |
typedef SettingFilesContainer::const_iterator | ConstSettingFilesIterator |
Const Iterator type for ObjectSettingGroup instances stored by this class. | |
typedef SettingGroupContainer::const_iterator | ConstSettingGroupIterator |
Const Iterator type for ObjectSettingGroup instances stored by this class. | |
typedef std::map< String, ObjectSettingFile * > | SettingFilesContainer |
Basic container type for ObjectSettingFile storage by this class. | |
typedef SettingFilesContainer::iterator | SettingFilesIterator |
Iterator type for ObjectSettingGroup instances stored by this class. | |
typedef std::map< String, ObjectSettingGroup * > | SettingGroupContainer |
Basic container type for ObjectSettingGroup storage by this class. | |
typedef SettingGroupContainer::iterator | SettingGroupIterator |
Iterator type for ObjectSettingGroup instances stored by this class. | |
typedef std::vector < ObjectSettingGroup * > | SettingGroupVector |
Convenience typedef for Load method returns. | |
Public Member Functions | |
GraphicsManager () | |
Basic constructor. More... | |
GraphicsManager (XML::Node &XMLNode) | |
XML constructor. More... | |
virtual | ~GraphicsManager () |
Class Destructor. | |
GameWindowIterator | BeginGameWindow () |
Gets an iterator to the first GameWindow stored in this manager. | |
ConstGameWindowIterator | BeginGameWindow () const |
Gets a const iterator to the first GameWindow stored in this manager. | |
GameWindow * | CreateGameWindow (const String &WindowCaption, const Whole &Width, const Whole &Height, const Whole &Flags) |
Creates a new game window to be rendered to. More... | |
virtual void | Deinitialize () |
Removes this manager from any necessary configuration so it can be safely disposed of. More... | |
void | DestroyAllGameWindows (bool ExcludePrimary=true) |
Destroys every game window created. More... | |
void | DestroyGameWindow (GameWindow *ToBeDestroyed) |
Destroys a created game window by index. More... | |
GameWindowIterator | EndGameWindow () |
Gets an iterator to one passed the last GameWindow stored in this manager. | |
ConstGameWindowIterator | EndGameWindow () const |
Gets a const iterator to one passed the last GameWindow stored in this manager. | |
Graphics::RenderSystem | GetCurrRenderSystem () |
Gets the current rendersystem being used. More... | |
const WindowSettings & | GetDesktopSettings () |
Gets the desktop display settings. More... | |
GameWindow * | GetGameWindow (const Whole &Index) const |
Gets a game window by index. More... | |
GameWindow * | GetGameWindow (const String &Caption) const |
Gets a game window by it's caption text. More... | |
virtual String | GetImplementationTypeName () const |
This Allows any manager name to be sent to a stream. Primarily used for logging. More... | |
virtual ManagerType | GetInterfaceType () const |
This returns the type of this manager. More... | |
Whole | GetNumGameWindows () const |
Gets the number of game windows within this manager. More... | |
GameWindow * | GetPrimaryGameWindow () |
Gets the primary(first) game window. More... | |
String | GetRenderSystemName (const Graphics::RenderSystem &RenderSys) |
Gets the name of the provided render system. More... | |
RenderWorkUnit * | GetRenderWork () |
Gets the work unit responsible for performing the graphics render of all scenes. More... | |
String | GetShortenedRenderSystemName (const Graphics::RenderSystem &RenderSys) |
Gets a short hand name of the provided render system. More... | |
const StringVector * | GetSupportedDevices () |
Gets a vector containing all the devices supported by this render system on the current hardware. More... | |
const StringVector * | GetSupportedResolutions () |
Gets a vector containing all the resolutions supported by this render system on the current hardware. More... | |
bool | HasOgreBeenInitialized () |
Gets whether or not Ogre has been started. More... | |
bool | HasSDLBeenInitialized () |
Gets whether or not SDL has been started. More... | |
virtual void | Initialize () |
Configures this manager for use prior to entering the main loop. More... | |
virtual void | RenderOneFrame () |
Renders one frame of the scene. | |
void | SetRenderSystem (const Graphics::RenderSystem &RenderSys, bool InitializeRenderSystem=false) |
Sets the render system to be used. More... | |
virtual void | SwapAllBuffers (bool WaitForVsync) |
Swaps all the buffers of all GameWindows. More... | |
Public Member Functions inherited from Mezzanine::ManagerBase | |
ManagerBase () | |
Class constructor. | |
virtual | ~ManagerBase () |
Class destructor. | |
virtual String | GetInterfaceTypeAsString () const |
Gets a string of the interface type of this manager. More... | |
bool | IsInitialized () const |
Gets whether or not this manager has been initialized. More... | |
Public Member Functions inherited from Mezzanine::ObjectSettingsHandler | |
ObjectSettingsHandler () | |
Class constructor. | |
virtual | ~ObjectSettingsHandler () |
Class destructor. | |
void | AddGroupToFile (ObjectSettingGroup *Group, const String &FileName) |
Assigns a SettingGroup to a file name that will be used when settings are saved. More... | |
void | ApplySettingGroup (const String &GroupName) |
Applies all the settings (and their values) defined in a setting group. More... | |
ObjectSettingFile * | CreateSettingFile (const String &FileName) |
Creates a new Setting file that will track which groups are a part of it. More... | |
ObjectSettingGroup * | CreateSettingGroup (const String &Name) |
Creates a new blank setting group that can have it's settings populated. More... | |
void | DestroyAllSettingFiles () |
Destroys all Setting files in this handler. More... | |
void | DestroyAllSettingGroups () |
Destroys all setting groups stored in this handler. | |
void | DestroySettingFile (const String &FileName) |
Destroys a Setting file by name. More... | |
void | DestroySettingFile (ObjectSettingFile *ToBeDestroyed) |
Destroys a Setting file. More... | |
void | DestroySettingGroup (const String &Name) |
Destroys a setting group by name. More... | |
void | DestroySettingGroup (ObjectSettingGroup *ToBeDestroyed) |
Destroys a setting group. More... | |
Boolean | GetAutoGenFiles () const |
Gets whether or not this object is currently allowed to create/update settings files upon initialization and destruction. More... | |
Boolean | GetAutoGenPath () const |
Gets whether or not this object is currently allowed to create folders when saving. More... | |
ConstString & | GetCurrentSettingsSaveFile () const |
Gets the name of the file the "Current" setting group is saved to. More... | |
ObjectSettingFile * | GetSettingFile (const String &FileName) |
Gets a Setting file by name. More... | |
ObjectSettingGroup * | GetSettingGroup (const String &Name) const |
Gets a setting group by name. More... | |
const String & | GetSettingsFilePath () const |
Gets the currently set settings file path. More... | |
CountedPtr< SettingGroupVector > | LoadSettings (const String &FileName, const String &Path) |
Loads settings from a settings file. More... | |
CountedPtr< SettingGroupVector > | LoadSettings (const String &FileName) |
Loads settings from a settings file using the specified settings path. More... | |
CountedPtr< SettingGroupVector > | LoadSettingsFromGroup (const String &FileName, const String &Group) |
Loads settings from a settings file. More... | |
CountedPtr< SettingGroupVector > | LoadSettingsFromXML (XML::Node &RootSettings) |
Loads settings from an xml node. More... | |
void | RemoveGroupFromFile (ObjectSettingGroup *Group, const String &FileName) |
Removes a previously assigned group from a save file name. More... | |
void | SaveAllSettings () |
Saves all settings that need saving. More... | |
void | SaveSettingGroups (StringVector &GroupNames, const String &FileName, const String &Path) |
Saves all settings to a settings file. More... | |
void | SaveSettingGroups (StringVector &GroupNames, const String &FileName) |
Saves all settings to a settings file using the specified settings path. More... | |
void | SaveSettingsByFile (const String &FileName, const String &Path) |
Saves all settings that have their optional filename set to the specified file. More... | |
void | SaveSettingsByFile (const String &FileName) |
Saves all settings that have their optional filename set to the specified file. More... | |
void | SaveSettingsToXML (XML::Node &RootSettings, Boolean SaveCurrent=true) |
Saves all the current setting groups as children of the provided XML node. More... | |
void | SaveSettingsToXML (StringVector &GroupNames, XML::Node &RootSettings) |
Saves the named settings groups as children of the provided XML node. More... | |
void | SetAutoGenFiles (Boolean Enable) |
Enables or disables the automatic creation of settings files on initialization and destruction of this object. More... | |
void | SetAutoGenPath (Boolean Enable) |
Enables or disables the automatic creation of a directory path when saving. More... | |
void | SetCurrentSettingsSaveFile (const String &FileName) |
Sets the name of the file that will have this object's "current" settings saved to. More... | |
void | SetSettingsFilePath (const String &Path) |
Sets the path to be assumed when saving/loading settings to files. More... | |
Public Member Functions inherited from Mezzanine::Singleton< GraphicsManager > | |
Singleton () | |
Class constructor. | |
~Singleton () | |
Class destructor. | |
Protected Member Functions | |
virtual void | AppendCurrentSettings (XML::Node &SettingsRootNode) |
Takes all the current settings of this handler and serializes them to an XML::Node. More... | |
virtual void | ApplySettingGroupImpl (ObjectSettingGroup *Group) |
Applies all the settings stored by a ObjectSettingGroup. More... | |
void | Construct () |
Construct the manager and set sane defaults. More... | |
virtual String | GetObjectRootNodeName () const |
Gets the name to be given to a Node with this handlers serialized data. More... | |
void | InitOgreRenderSystem () |
Initializes the internal graphics subsystem with the currently set configuration. More... | |
Protected Member Functions inherited from Mezzanine::ObjectSettingsHandler | |
void | LoadSettingSetFromXML (XML::Node &XMLNode, ObjectSettingSet *Set) |
Populates an ObjectSettingSet with settings stored in XML. More... | |
CountedPtr< SettingGroupVector > | LoadSettingsFromFile (const String &FileName, const String &Path) |
Loads all ObjectSettingGroup instances serialized to a XML file into usable ObjectSettingGroup instances. More... | |
void | SaveSettingSetToXML (XML::Node &XMLNode, ObjectSettingSet *Set) |
Saves an ObjectSettingSet to an XML node. More... | |
void | SaveSettingsToFile (StringVector &GroupNames, const String &FileName, const String &Path) |
Saves a collection of ObjectSettingGroups stored by this handler to a file as XML. More... | |
Protected Attributes | |
Graphics::RenderSystem | CurrRenderSys |
A RenderSystem enum value storing the RenderSystem type currently in use. More... | |
WindowSettings | DesktopSettings |
A struct storing the dimensions of the desktop on the current hardware. More... | |
GameWindowContainer | GameWindows |
A container storing all the game windows created by this manager. More... | |
Boolean | OgreBeenInitialized |
Stores whether the internal graphics subsystem has been initialized. More... | |
GameWindow * | PrimaryGameWindow |
A pointer to the hidden window storing the context and render resources. More... | |
InternalPluginContainer | RenderSystems |
Track all statically linked Ogre render systems, usually only one, but could be many. More... | |
RenderSystemTypeContainer | RenderSystemTypes |
A listing of the types of rendersystems Types that correspond to the entry in RenderSystems. More... | |
RenderWorkUnit * | RenderWork |
The work unit that does all the rendering. More... | |
StringVector | SupportedDevices |
A container of strings storing all the detected names of video devices on the current hardware. More... | |
StringVector | SupportedResolutions |
A container of strings storing all the detected supported resolutions on the current hardware. More... | |
Threading::DefaultThreadSpecificStorage::Type * | ThreadResources |
Can be used for thread safe logging and other thread Specific resources. More... | |
Protected Attributes inherited from Mezzanine::ManagerBase | |
bool | Initialized |
Simple bool indicating whether or not this manager has been initialized. More... | |
Entresol * | TheEntresol |
The actual pointer to the Entresol core class. More... | |
Protected Attributes inherited from Mezzanine::ObjectSettingsHandler | |
Boolean | AutoGenFiles |
Stores whether or not this handler will attempt to automatically generate a file if it doesn't exist. More... | |
Boolean | AutoGenPath |
Stores whether or not this handler will attempt to automatically generate a path to a file if it doesn't exist. More... | |
String | CurrentSettingsSaveFile |
Stores the name of the file where the "Current" settings group will be saved to. More... | |
SettingFilesContainer | SettingFiles |
A container storing all the file saving configuration used by this handler. More... | |
SettingGroupContainer | SettingGroups |
A container storing all the SettingGroups owned by this handler. More... | |
String | SettingsFilePath |
Stores the path to be used for file IO operations done by this handler. More... | |
Friends | |
class | RenderWorkUnit |
The RenderWorkUnit really is an extension of the GraphicsManager, it just exists as a Functor for the sake of simplicity. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Mezzanine::ManagerBase | |
static String | GetTypeAsString (const ManagerType &ManagerType) |
Gets the string form of the type of manager. More... | |
static ManagerType | GetTypeFromString (const String &ManagerName) |
Gets the type of manager requested from a string. More... | |
Static Public Member Functions inherited from Mezzanine::Singleton< GraphicsManager > | |
static GraphicsManager * | GetSingletonPtr () |
Fetches a pointer to the singleton. More... | |
static bool | SingletonValid () |
Checks to see if the singleton pointer is valid. More... | |
Static Protected Attributes inherited from Mezzanine::Singleton< GraphicsManager > | |
static GraphicsManager * | SingletonPtr |
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 119 of file graphicsmanager.h.
Mezzanine::Graphics::GraphicsManager::GraphicsManager | ( | ) |
Basic constructor.
This creates a basic Graphics Settings with resolution 640x480 with fullscreen set to false
Definition at line 116 of file graphicsmanager.cpp.
Mezzanine::Graphics::GraphicsManager::GraphicsManager | ( | XML::Node & | XMLNode) |
XML constructor.
XMLNode | The node of the xml document to construct from. |
Definition at line 127 of file graphicsmanager.cpp.
|
protectedvirtual |
Takes all the current settings of this handler and serializes them to an XML::Node.
Implements Mezzanine::ObjectSettingsHandler.
Definition at line 288 of file graphicsmanager.cpp.
|
protectedvirtual |
Applies all the settings stored by a ObjectSettingGroup.
Implements Mezzanine::ObjectSettingsHandler.
Definition at line 320 of file graphicsmanager.cpp.
|
protected |
Construct the manager and set sane defaults.
Definition at line 208 of file graphicsmanager.cpp.
GameWindow * Mezzanine::Graphics::GraphicsManager::CreateGameWindow | ( | const String & | WindowCaption, |
const Whole & | Width, | ||
const Whole & | Height, | ||
const Whole & | Flags | ||
) |
Creates a new game window to be rendered to.
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 GameWindow class for more info. |
Definition at line 464 of file graphicsmanager.cpp.
|
virtual |
Removes this manager from any necessary configuration so it can be safely disposed of.
Implements Mezzanine::ManagerBase.
Definition at line 668 of file graphicsmanager.cpp.
void Mezzanine::Graphics::GraphicsManager::DestroyAllGameWindows | ( | bool | ExcludePrimary = true ) |
Destroys every game window created.
ExcludePrimary | Whether or not you want to spare the primary window created. |
Definition at line 508 of file graphicsmanager.cpp.
void Mezzanine::Graphics::GraphicsManager::DestroyGameWindow | ( | GameWindow * | ToBeDestroyed) |
Destroys a created game window by index.
WindowIndex | The index of the window to be destroyed. |
Definition at line 495 of file graphicsmanager.cpp.
Graphics::RenderSystem Mezzanine::Graphics::GraphicsManager::GetCurrRenderSystem | ( | ) |
Gets the current rendersystem being used.
Definition at line 558 of file graphicsmanager.cpp.
const WindowSettings & Mezzanine::Graphics::GraphicsManager::GetDesktopSettings | ( | ) |
Gets the desktop display settings.
Returns | a WindowSettings struct with the desktop display settings. |
Definition at line 608 of file graphicsmanager.cpp.
GameWindow * Mezzanine::Graphics::GraphicsManager::GetGameWindow | ( | const Whole & | Index) | const |
Gets a game window by index.
Index | The index of the window to retrieve. |
Definition at line 474 of file graphicsmanager.cpp.
GameWindow * Mezzanine::Graphics::GraphicsManager::GetGameWindow | ( | const String & | Caption) | const |
Gets a game window by it's caption text.
Caption | The caption of the window to retrieve. |
Definition at line 479 of file graphicsmanager.cpp.
|
virtual |
This Allows any manager name to be sent to a stream. Primarily used for logging.
Implements Mezzanine::ManagerBase.
Definition at line 708 of file graphicsmanager.cpp.
|
virtual |
This returns the type of this manager.
This is intended to make using and casting from Manager base easier. With this is is possible to cast from ManagerBase to the correct Manager Type.
Implements Mezzanine::ManagerBase.
Definition at line 705 of file graphicsmanager.cpp.
Whole Mezzanine::Graphics::GraphicsManager::GetNumGameWindows | ( | ) | const |
Gets the number of game windows within this manager.
Definition at line 490 of file graphicsmanager.cpp.
|
protectedvirtual |
Gets the name to be given to a Node with this handlers serialized data.
Implements Mezzanine::ObjectSettingsHandler.
Definition at line 283 of file graphicsmanager.cpp.
GameWindow * Mezzanine::Graphics::GraphicsManager::GetPrimaryGameWindow | ( | ) |
Gets the primary(first) game window.
Definition at line 521 of file graphicsmanager.cpp.
String Mezzanine::Graphics::GraphicsManager::GetRenderSystemName | ( | const Graphics::RenderSystem & | RenderSys) |
Gets the name of the provided render system.
RenderSys | The rendersystem to get the name of. |
Definition at line 563 of file graphicsmanager.cpp.
RenderWorkUnit * Mezzanine::Graphics::GraphicsManager::GetRenderWork | ( | ) |
Gets the work unit responsible for performing the graphics render of all scenes.
Definition at line 686 of file graphicsmanager.cpp.
String Mezzanine::Graphics::GraphicsManager::GetShortenedRenderSystemName | ( | const Graphics::RenderSystem & | RenderSys) |
Gets a short hand name of the provided render system.
RenderSys | The rendersystem to get the name of. |
Definition at line 579 of file graphicsmanager.cpp.
const StringVector * Mezzanine::Graphics::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.
Definition at line 603 of file graphicsmanager.cpp.
const StringVector * Mezzanine::Graphics::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.
Definition at line 598 of file graphicsmanager.cpp.
bool Mezzanine::Graphics::GraphicsManager::HasOgreBeenInitialized | ( | ) |
Gets whether or not Ogre has been started.
Definition at line 697 of file graphicsmanager.cpp.
bool Mezzanine::Graphics::GraphicsManager::HasSDLBeenInitialized | ( | ) |
Gets whether or not SDL has been started.
Definition at line 692 of file graphicsmanager.cpp.
|
virtual |
Configures this manager for use prior to entering the main loop.
Added a GraphicWorkUnit to the WorkScheduler on the Entresol as a Monopoly, Initializes the Render device and rendering system if that has not already been done, if configured to will save all graphics configuration files.
Implements Mezzanine::ManagerBase.
Definition at line 629 of file graphicsmanager.cpp.
|
protected |
Initializes the internal graphics subsystem with the currently set configuration.
Definition at line 228 of file graphicsmanager.cpp.
void Mezzanine::Graphics::GraphicsManager::SetRenderSystem | ( | const Graphics::RenderSystem & | RenderSys, |
bool | InitializeRenderSystem = false |
||
) |
Sets the render system to be used.
RenderSys | The Render system to be used. |
InitializeRenderSystem | Whether to immediately initialize the rendersystem afterwords. |
Definition at line 549 of file graphicsmanager.cpp.
|
virtual |
Swaps all the buffers of all GameWindows.
WaitForVsync | Whether or not the buffer should swap after the vsync interval is completed. |
Definition at line 623 of file graphicsmanager.cpp.
|
friend |
The RenderWorkUnit really is an extension of the GraphicsManager, it just exists as a Functor for the sake of simplicity.
Definition at line 135 of file graphicsmanager.h.
|
protected |
A RenderSystem enum value storing the RenderSystem type currently in use.
Definition at line 167 of file graphicsmanager.h.
|
protected |
A struct storing the dimensions of the desktop on the current hardware.
Definition at line 153 of file graphicsmanager.h.
|
protected |
A container storing all the game windows created by this manager.
Definition at line 144 of file graphicsmanager.h.
|
protected |
Stores whether the internal graphics subsystem has been initialized.
Definition at line 170 of file graphicsmanager.h.
|
protected |
A pointer to the hidden window storing the context and render resources.
Definition at line 156 of file graphicsmanager.h.
|
protected |
Track all statically linked Ogre render systems, usually only one, but could be many.
Definition at line 138 of file graphicsmanager.h.
|
protected |
A listing of the types of rendersystems Types that correspond to the entry in RenderSystems.
Definition at line 141 of file graphicsmanager.h.
|
protected |
The work unit that does all the rendering.
Definition at line 160 of file graphicsmanager.h.
|
protected |
A container of strings storing all the detected names of video devices on the current hardware.
Definition at line 150 of file graphicsmanager.h.
|
protected |
A container of strings storing all the detected supported resolutions on the current hardware.
Definition at line 147 of file graphicsmanager.h.
|
protected |
Can be used for thread safe logging and other thread Specific resources.
Definition at line 163 of file graphicsmanager.h.