Box2D Cannon Game
Ian Parberry's "Introduction to Game Physics with Box2D"
Static Protected Attributes | List of all members
CCommon Class Reference

The common variables class. More...

#include <Common.h>

Inheritance diagram for CCommon:
CCannon CGame CHeadsUpDisplay CObject CObjectManager

Static Protected Attributes

static b2World * m_pPhysicsWorld = nullptr
 Pointer to Box2D Physics World.
 
static CRendererm_pRenderer = nullptr
 Pointer to Render World.
 
static CObjectManagerm_pObjectManager = nullptr
 Pointer to object manager.

 
static LParticleEngine2D * m_pParticleEngine = nullptr
 Pointer to particle engine.
 
static bool m_bEasterEgg = false
 Easter egg!
 

Detailed Description

The common variables class.

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.