![]() |
The LARC Game Engine
A Simple Game Engine from the Laboratory for Recreational Computing
|
Settings manager. More...
#include <Settings.h>
Public Member Functions | |
| void | Load () |
| Load game settings. More... | |
Protected Member Functions | |
| void | SetWinSize (int, int) |
| Set window size information. More... | |
Static Protected Attributes | |
| static XMLElement * | m_pXmlSettings = nullptr |
| Pointer to the settings tag in the XML settings file. | |
| static float | m_fAspectRatio = 1.0f |
| Aspect ratio, width/ht. | |
Static Protected Attributes inherited from LSettings | |
| static char | m_szName [MAX_PATH] |
| Name of this game. | |
| static int | m_nWinWidth = 0 |
| Window width in pixels. | |
| static int | m_nWinHeight = 0 |
| Window height in pixels. | |
| static Vector2 | m_vWinCenter = Vector2::Zero |
| Window center. | |
Private Attributes | |
| tinyxml2::XMLDocument | m_xmlDoc |
| TinyXML2 document. | |
This class provides access to the game settings from file gamesettings.xml. TinyXML2 is my preferred XML file parser, not the one provided by Microsoft.
| void LSettingsManager::Load | ( | ) |
Load settings from a fixed settings file, gamesettings.xml.
|
protected |
Store the window's width and height, and compute and store the aspect ratio and the position of the window center (ie. half its width and half its height).
| w | Window client area width in pixels. |
| h | Window client area height in pixels. |