#include <OpenGUI_System.h>
The construction and destruction of this class marks the initialization and shutdown of OpenGUI as a whole. You must have a valid System object before you can use most other subsystems of OpenGUI, and destruction of the System object will cause the destruction of all subsystems as well.
This class is implemented using the Singleton system. There can only be one System object instantiated at any point in time.
Public Member Functions | |
| System (Renderer *renderer, ResourceProvider *resourceProvider=NULL, std::string logFile="OpenGUI.log") | |
| The constructor for the System object. | |
| System (Renderer *renderer, ResourceProvider *resourceProvider, LogListener *logListener) | |
| void | loadPlugin (std::string filename) |
| loads a plugin by filename | |
| void | unloadPlugin (std::string filename) |
| unloads a plugin by filename | |
| void | update () |
| Updates all subsystems in the necessary order. | |
| void | updateScreens () |
| Updates all auto updating properties of all Screens. | |
| void | updateTime () |
| Updates the TimerManager using the built in time advancement code. | |
| ResourceProvider * | _getResourceProvider () |
| Returns a pointer to the registered ResourceProvider. Apps really shouldn't need, or use, this. | |
Static Public Member Functions | |
| static System & | getSingleton (void) |
| Retrieve the current singleton, if one exists. If none exists, this will cause an error. | |
| static System * | getSingletonPtr (void) |
| Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0. | |
| OpenGUI::System::System | ( | Renderer * | renderer, | |
| ResourceProvider * | resourceProvider = NULL, |
|||
| std::string | logFile = "OpenGUI.log" | |||
| ) |
The constructor for the System object.
Firstly, the System object is a singleton, so only one can exist in an application at any given point in time.
In order to create an instance of the System object, you must provide a pointer to a valid Renderer. The resourceProvider pointer is optional, as a generic implementation of that comes pre-built with the library.
| renderer | pointer to a valid Renderer object | |
| resourceProvider | pointer to a valid ResourceProvider object, or 0 to use the built in generic ResourceProvider | |
| logFile | name of the log file to write log message to. If "" is used, no log file will be created |
| OpenGUI::System::System | ( | Renderer * | renderer, | |
| ResourceProvider * | resourceProvider, | |||
| LogListener * | logListener | |||
| ) |
As the other constructor except a log listener is passed in place of a log filename.
| renderer | pointer to a valid Renderer object | |
| resourceProvider | pointer to a valid ResourceProvider object, or 0 to use the built in generic ResourceProvider | |
| logListener | A valid pointer to a LogListener, or 0 for no logging. |
| ResourceProvider* OpenGUI::System::_getResourceProvider | ( | ) | [inline] |
Returns a pointer to the registered ResourceProvider. Apps really shouldn't need, or use, this.
| System & OpenGUI::System::getSingleton | ( | void | ) | [static] |
Retrieve the current singleton, if one exists. If none exists, this will cause an error.
| System * OpenGUI::System::getSingletonPtr | ( | void | ) | [static] |
Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0.
| void OpenGUI::System::loadPlugin | ( | std::string | filename | ) |
loads a plugin by filename
| void OpenGUI::System::unloadPlugin | ( | std::string | filename | ) |
unloads a plugin by filename
| void OpenGUI::System::update | ( | ) |
Updates all subsystems in the necessary order.
The following functions are called in the given order:
| void OpenGUI::System::updateScreens | ( | ) |
Updates all auto updating properties of all Screens.
The following functions are called in the given order:
| void OpenGUI::System::updateTime | ( | ) |
Updates the TimerManager using the built in time advancement code.