Functions | |
InputState & | InputState () |
Returns a reference to the InputState singleton object. | |
KeyMap const & | KeyMap () |
Returns a const reference to the KeyMap singleton object. | |
Pal & | Pal () |
Returns a reference to the Platform-specific singleton instance of the Pal interface. | |
ResourceLibrary & | ResourceLibrary () |
Returns a reference to the ResourceLibrary singleton object. | |
void | Initialize (PalFactory CreatePal, char const *key_map_name) |
Initializes the singleton objects. | |
void | Shutdown () |
Shuts down the singleton objects. |
Contains functions Initialize and Shutdown which should be the first and last things done, respectively, by the main
function. The singleton objects are set up and shut down by these functions. The singletons can then be accessed via calls to the respective accessor functions.
void Xrb::Singleton::Initialize | ( | PalFactory | CreatePal, | |
char const * | key_map_name | |||
) |
Initializes the singleton objects.
This should be the first thing done, because other systems require the usage of the singleton objects. If this function is not called before other systems activate, the singleton object accessors will assert.
key_map_name
can be specified to perform key mapping to supplement the windows-version-of-SDL's lack of alternate keyboard layout support (e.g. Dvorak). This is not necessary in Unix (it is currently unknown if it is necessary for Mac OS).
CreatePal | Specifies the platform-specific factory function for creating an instance of Pal. The returned object will be deleted during Shutdown. | |
key_map_name | Specifies the name of the KeyMap to use. Must not be NULL . See KeyMap::Create for valid arguments. |
Definition at line 68 of file xrb_singleton.cpp.
References Xrb::KeyMap::Create(), InputState(), and ResourceLibrary().
void Xrb::Singleton::Shutdown | ( | ) |
Shuts down the singleton objects.
This should be the last thing done, so that proper cleanup is performed for the singleton objects.
Definition at line 88 of file xrb_singleton.cpp.
References Xrb::DeleteAndNullify().