SAGE
A Simple Academic Game Engine
Loading...
Searching...
No Matches
Sage::CSettingsManager Class Reference

Settings manager. More...

#include <SageSettings.h>

Inheritance diagram for Sage::CSettingsManager:
Collaboration diagram for Sage::CSettingsManager:

Public Member Functions

void Load ()
 Load game settings.
 

Protected Member Functions

void SetWinSize (int, int)
 Set window size information.
 

Static Protected Attributes

static tinyxml2::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 Sage::CSettings
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.
 

Detailed Description

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.

Member Function Documentation

◆ Load()

void CSettingsManager::Load ( )

Load settings from a fixed settings file, gamesettings.xml.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetWinSize()

void CSettingsManager::SetWinSize ( int w,
int h )
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).

Parameters
wWindow client area width in pixels.
hWindow client area height in pixels.
Here is the caller graph for this function: