Box2D Binary Counter
Ian Parberry's "Introduction to Game Physics"
Public Member Functions | List of all members
CRenderer Class Reference

The Renderer. More...

#include <Renderer.h>

Inheritance diagram for CRenderer:

Public Member Functions

 CRenderer ()
 Constructor.
 
void LoadImages ()
 Load images. More...
 
void DrawOverflow (bool)
 
void DrawNumber (UINT)
 Draw a 2-digit number as text. More...
 
void DrawNixieBits (UINT, UINT)
 Draw number using nixie tubes. More...
 

Detailed Description

The Renderer.

Render world handles the game-specific rendering tasks, relying on the base class to do all of the actual API-specific rendering.

Member Function Documentation

◆ DrawNixieBits()

void CRenderer::DrawNixieBits ( UINT  n,
UINT  m 
)

Draw number using nixie tubes.

Draw a number in binary using nixie tubes in a hard-coded position, with a hard-coded gap between the tubes. Yes, nixie tubes are a thing: https://en.wikipedia.org/wiki/Nixie_tube.

Parameters
nNumber to display in binary.
mNumber of bits.

◆ DrawNumber()

void CRenderer::DrawNumber ( UINT  n)

Draw a 2-digit number as text.

Draw a 2-digit number in a hard-coded position. If the number has more than two digits, the two least-significant ones will be drawn and the rest will be ignored. This function works by printing the number into a text buffer and then using CRenderer's DrawText function to draw it.

Parameters
nThe number to be drawn.

◆ DrawOverflow()

void CRenderer::DrawOverflow ( bool  bOflo)

If there is overflow, flash the warning led on and off. Otherwise just draw it unlit.

◆ LoadImages()

void CRenderer::LoadImages ( )

Load images.

Load the specific images needed for this game. This is where eSprite values from GameDefines.h get tied to the names of sprite tags in gamesettings.xml. Those sprite tags contain the name of the corresponding image file. If the image tag or the image file are missing, then the game should abort from deeper in the Engine code, leaving you with a dialog box that tells you what went wrong.