The LARC Game Engine
A Simple Game Engine from the Laboratory for Recreational Computing
Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Attributes | List of all members
LSettingsManager Class Reference

Settings manager. More...

#include <Settings.h>

Inheritance diagram for LSettingsManager:
LSettings LSound LWindow LRenderer3D LSpriteRenderer

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.
 

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 LSettingsManager::Load ( )

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

◆ SetWinSize()

void LSettingsManager::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.