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 ResolutionContainer::const_iterator | ConstResolutionIterator |
Const Iterator type for stored supported resolutions. | |
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< RenderSystem > | RenderSystemTypeContainer |
Basic container type for registered rendersystem type storage by this class. | |
typedef std::vector< Resolution > | ResolutionContainer |
Basic container type for storing the detected supported fullscreen resolutions on the current system. | |
typedef ResolutionContainer::iterator | ResolutionIterator |
Iterator type for stored supported resolutions. | |
Public Types inherited from Mezzanine::ManagerBase | |
enum | ManagerType { MT_Undefined = 0, MT_AudioManager = 1, MT_AnimationManager = 2, MT_CollisionShapeManager = 3, MT_CompositorManager = 4, MT_GraphicsManager = 5, MT_EventManager = 6, MT_InputManager = 7, MT_LogManager = 8, MT_MaterialManager = 9, MT_MeshManager = 10, MT_NetworkManager = 11, MT_ResourceManager = 12, MT_ScriptingManager = 13, MT_TextureManager = 14, MT_UIManager = 15, MT_ActorManager = 101, MT_AreaEffectManager = 102, MT_DebrisManager = 103, MT_PagingManager = 104, MT_PhysicsManager = 105, MT_SceneManager = 106, MT_SoundScapeManager = 107, MT_TerrainManager = 108, MT_VehicleManager = 109, MT_UserCreated = 512 } |
A listing of Manager Types. More... | |
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 (const 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 (Boole 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 () const |
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 () const |
Gets a vector containing all the devices supported by this render system on the current hardware. More... | |
const ResolutionContainer & | GetSupportedResolutions () const |
Gets a vector containing all the resolutions supported by this render system on the current hardware. More... | |
Boole | HasOgreBeenInitialized () |
Gets whether or not Ogre has been started. More... | |
Boole | 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, Boole InitializeRenderSystem=false) |
Sets the render system to be used. More... | |
virtual void | SwapAllBuffers (Boole WaitForVsync) |
Swaps all the buffers of all GameWindows. More... | |
Public Member Functions inherited from Mezzanine::EntresolManager | |
EntresolManager () | |
Class constructor. | |
virtual | ~EntresolManager () |
Class destructor. | |
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... | |
Boole | 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... | |
Boole | GetAutoGenFiles () const |
Gets whether or not this object is currently allowed to create/update settings files upon initialization and destruction. More... | |
Boole | 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 | ProtoDeSerialize (const XML::Node &SelfRoot) |
Take the data stored in an XML Node and overwrite this object with it. More... | |
void | ProtoSerialize (XML::Node &SelfRoot) const |
Convert this class to an XML::Node ready for serialization. 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, Boole 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 (Boole Enable) |
Enables or disables the automatic creation of settings files on initialization and destruction of this object. More... | |
void | SetAutoGenPath (Boole 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 destructor. | |
Static Public Attributes | |
static const String | ImplementationName = "DefaultGraphicsManager" |
A String containing the name of this manager implementation. | |
static const ManagerBase::ManagerType | InterfaceType = ManagerBase::MT_GraphicsManager |
A ManagerType enum value used to describe the type of interface/functionality this manager provides. | |
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 Member Functions inherited from Mezzanine::Singleton< GraphicsManager > | |
Singleton () | |
Class constructor. | |
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... | |
Boole | 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... | |
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... | |
ResolutionContainer | 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 | |
Boole | Initialized |
Simple Boole 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 | |
Boole | AutoGenFiles |
Stores whether or not this handler will attempt to automatically generate a file if it doesn't exist. More... | |
Boole | 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::ObjectSettingsHandler | |
static String | GetSerializableName () |
Get the name of the the XML tag the class will leave behind as its instances are serialized. More... | |
Static Public Member Functions inherited from Mezzanine::Singleton< GraphicsManager > | |
static GraphicsManager * | GetSingletonPtr () |
Fetches a pointer to the singleton. More... | |
static Boole | SingletonValid () |
Checks to see if the singleton pointer is valid. More... | |
Static Protected Attributes inherited from Mezzanine::Singleton< GraphicsManager > | |
static GraphicsManager * | SingletonPtr |
The one and only pointer to the single object. More... | |
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 124 of file graphicsmanager.cpp.
Mezzanine::Graphics::GraphicsManager::GraphicsManager | ( | const XML::Node & | XMLNode | ) |
XML constructor.
XMLNode | The node of the xml document to construct from. |
Definition at line 135 of file graphicsmanager.cpp.
|
protectedvirtual |
Takes all the current settings of this handler and serializes them to an XML::Node.
CurrentNode | The XML::Node to be populated with this handlers current settings. |
Implements Mezzanine::ObjectSettingsHandler.
Definition at line 249 of file graphicsmanager.cpp.
|
protectedvirtual |
Applies all the settings stored by a ObjectSettingGroup.
Group | The ObjectSettingGroup to have all of it's settings applied. |
Implements Mezzanine::ObjectSettingsHandler.
Definition at line 261 of file graphicsmanager.cpp.
|
protected |
Construct the manager and set sane defaults.
Definition at line 185 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 425 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 636 of file graphicsmanager.cpp.
void Mezzanine::Graphics::GraphicsManager::DestroyAllGameWindows | ( | Boole | ExcludePrimary = true | ) |
Destroys every game window created.
ExcludePrimary | Whether or not you want to spare the primary window created. |
Definition at line 468 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 456 of file graphicsmanager.cpp.
Graphics::RenderSystem Mezzanine::Graphics::GraphicsManager::GetCurrRenderSystem | ( | ) |
Gets the current rendersystem being used.
Definition at line 517 of file graphicsmanager.cpp.
const WindowSettings & Mezzanine::Graphics::GraphicsManager::GetDesktopSettings | ( | ) | const |
Gets the desktop display settings.
Returns | a WindowSettings struct with the desktop display settings. |
Definition at line 565 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 435 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 440 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 680 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 677 of file graphicsmanager.cpp.
Whole Mezzanine::Graphics::GraphicsManager::GetNumGameWindows | ( | ) | const |
Gets the number of game windows within this manager.
Definition at line 451 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 244 of file graphicsmanager.cpp.
GameWindow * Mezzanine::Graphics::GraphicsManager::GetPrimaryGameWindow | ( | ) |
Gets the primary(first) game window.
Definition at line 480 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 522 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 658 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 537 of file graphicsmanager.cpp.
const StringVector & Mezzanine::Graphics::GraphicsManager::GetSupportedDevices | ( | ) | const |
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 560 of file graphicsmanager.cpp.
const GraphicsManager::ResolutionContainer & Mezzanine::Graphics::GraphicsManager::GetSupportedResolutions | ( | ) | const |
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 555 of file graphicsmanager.cpp.
Boole Mezzanine::Graphics::GraphicsManager::HasOgreBeenInitialized | ( | ) |
Gets whether or not Ogre has been started.
Definition at line 669 of file graphicsmanager.cpp.
Boole Mezzanine::Graphics::GraphicsManager::HasSDLBeenInitialized | ( | ) |
Gets whether or not SDL has been started.
Definition at line 664 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 599 of file graphicsmanager.cpp.
|
protected |
Initializes the internal graphics subsystem with the currently set configuration.
Definition at line 223 of file graphicsmanager.cpp.
void Mezzanine::Graphics::GraphicsManager::SetRenderSystem | ( | const Graphics::RenderSystem & | RenderSys, |
Boole | 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 508 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 593 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 144 of file graphicsmanager.h.
|
protected |
A RenderSystem enum value storing the RenderSystem type currently in use.
Definition at line 170 of file graphicsmanager.h.
|
protected |
A struct storing the dimensions of the desktop on the current hardware.
Definition at line 156 of file graphicsmanager.h.
|
protected |
A container storing all the game windows created by this manager.
Definition at line 147 of file graphicsmanager.h.
|
protected |
Stores whether the internal graphics subsystem has been initialized.
Definition at line 173 of file graphicsmanager.h.
|
protected |
A pointer to the hidden window storing the context and render resources.
Definition at line 159 of file graphicsmanager.h.
|
protected |
The work unit that does all the rendering.
Definition at line 163 of file graphicsmanager.h.
|
protected |
A container of strings storing all the detected names of video devices on the current hardware.
Definition at line 153 of file graphicsmanager.h.
|
protected |
A container of strings storing all the detected supported resolutions on the current hardware.
Definition at line 150 of file graphicsmanager.h.
|
protected |
Can be used for thread safe logging and other thread Specific resources.
Definition at line 166 of file graphicsmanager.h.