Box2D Binary Counter
Game Physics with a 2D Physics Engine
Loading...
Searching...
No Matches
GameDefines.h File Reference

Game specific defines.

#include "SageDefines.h"
#include "Box2D\Box2D.h"
Include dependency graph for GameDefines.h:
This graph shows which files directly or indirectly include this file:

Enumerations

enum class  eGameState { Loading , Playing }
 Game state type. More...
 
enum class  eSprite {
  Background , One , Zero , Ledge ,
  Ramp , Block , Arm , Leg ,
  Leg2 , Ring , RedLEDOn , RedLEDOff ,
  LED , Nixie0 , Nixie1 , Line
}
 Sprite enumerated type. More...
 
enum class  eSound {
  Overflow , Bonk , Squeek , Ding ,
  Zero , One
}
 Sound enumerated type. More...
 
enum class  eDrawMode { Sprites , Both , Lines , Wrap }
 Draw mode enumerated type. More...
 

Functions

float PW2RW (float x)
 Physics World to Render World units for a float. Physics World to Render World units for a float.
 
Vector2 PW2RW (const b2Vec2 &v)
 Physics World to Render World units for a 2D vector. Physics World to Render World units for a 2D vector.
 
float RW2PW (float x)
 Render World to Physics World units for a float. Render World to Physics World units for a float.
 
float RW2PW (int x)
 Render World to Physics World units for an int. Render World to Physics World units for an integer.
 
b2Vec2 RW2PW (int x, int y)
 Render World to Physics World units for a pair of integers. Render World to Physics World units for a 2D vector provided as a pair of integers.
 
b2Vec2 RW2PW (const Vector2 &v)
 Physics World to Render World units for a vector.
 

Variables

const float fPRV = 10.0f
 Physics World to Render World rescale value.
 

Enumeration Type Documentation

◆ eDrawMode

enum class eDrawMode
strong

An enumerated type for the drawing mode.

◆ eGameState

enum class eGameState
strong

An enumerated type for the game state.

◆ eSound

enum class eSound
strong

An enumerated type for the sounds, which will be cast to an unsigned integer and used for the index of the corresponding sample. Size must be last.

◆ eSprite

enum class eSprite
strong

An enumerated type for the sprites, which will be cast to an unsigned integer and used for the index of the corresponding texture in graphics memory.

Function Documentation

◆ PW2RW() [1/2]

Vector2 PW2RW ( const b2Vec2 & v)
inline
Parameters
vA 2D vector in Physics World units.
Returns
The equivalent vector in Render World units.

◆ PW2RW() [2/2]

float PW2RW ( float x)
inline
Parameters
xA floating point value in Physics World units.
Returns
The equivalent value in Render World units.
Here is the caller graph for this function:

◆ RW2PW() [1/4]

b2Vec2 RW2PW ( const Vector2 & v)
inline
Parameters
vA 2D vector in Render World units.
Returns
The equivalent vector in Physics World units.

◆ RW2PW() [2/4]

float RW2PW ( float x)
inline
Parameters
xA floating point value in Render World units.
Returns
The equivalent value in Physics World units.
Here is the caller graph for this function:

◆ RW2PW() [3/4]

float RW2PW ( int x)
inline
Parameters
xAn integer value in Render World units.
Returns
The equivalent floating point value in Physics World units.

◆ RW2PW() [4/4]

b2Vec2 RW2PW ( int x,
int y )
inline
Parameters
xAn integer value in Render World units.
yAn integer value in Render World units.
Returns
The equivalent 2D vector in Physics World units.