![]() |
The Pinball Game
Ian Parberry's "Introduction to Game Physics"
|
The common variables class. More...
#include <Common.h>
Static Protected Attributes | |
| static CRenderer * | m_pRenderer = nullptr |
| Pointer to the renderer. | |
| static CObjectManager * | m_pObjectManager = nullptr |
| Pointer to the object manager. | |
| static UINT | m_nMIterations = 4 |
| Number of motion iterations. | |
| static UINT | m_nCIterations = 1 |
| Number of collision iterations. | |
| static float | m_fFrequency = 60.0f*m_nMIterations |
| Frequency, number of physics iterations per second. | |
| static eDrawMode | m_eDrawMode = eDrawMode::Background |
| Draw mode. | |
| static bool | m_bBallInPlay = false |
| Is there a ball currently in play? | |
| static UINT | m_nScore = 0 |
| Current score. | |
CCommon is a singleton class that encapsulates things that are common to different game components, including game state variables. Making it a singleton class means that we can avoid passing its member variables around as parameters, which makes the code minisculely faster, and more importantly, reduces function clutter.