![]() |
Box2D Joint Toy
Game Physics with a 2D Physics Engine
|
The common variables class. More...
#include <Common.h>


Static Protected Attributes | |
| static b2World * | m_pPhysicsWorld = nullptr |
| Pointer to Box2D Physics World. | |
| static CBox2DRenderer * | m_pRenderer = nullptr |
| Pointer to the renderer. | |
| static CLevel * | m_pLevel = nullptr |
| Pointer to current level. | |
| static eLevel | m_eCurLevel = eLevel::Windmill |
| Current level. | |
| static eDrawMode | m_eDrawMode = eDrawMode::Sprites |
| Draw mode. | |
CCommon is a monostate class that encapsulates things that are common to different game components, including game state variables. Making it a monostate class means that we can avoid passing its member variables around as parameters, which makes the code minisculely faster, and more importantly, makes the code more readable by reducing function clutter.