![]() |
Box2D Binary Counter
Ian Parberry's "Introduction to Game Physics"
|
The Renderer. More...
#include <Renderer.h>
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... | |
The Renderer.
Render world handles the game-specific rendering tasks, relying on the base class to do all of the actual API-specific rendering.
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.
n | Number to display in binary. |
m | Number of bits. |
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.
n | The number to be drawn. |
void CRenderer::DrawOverflow | ( | bool | bOflo | ) |
If there is overflow, flash the warning led on and off. Otherwise just draw it unlit.
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.