GameHelperBase

This is the base class for your game.

Members

Functions

drawFrame
void drawFrame()

Implement this to draw.

forceRedraw
void forceRedraw()

Forces a redraw even if update returns false

getWindow
SimpleWindow getWindow()

Returns the main game window. This function will only be called once if you use runGame. You should return a window here like one created with create2dWindow.

update
bool update(Duration deltaTime)

Implement this to update. The deltaTime tells how much real time has passed since the last update. Returns true if anything changed, which will queue up a redraw

wantAudio
bool wantAudio()

Override this and return true to initialize the audio system. Note that trying to use the audio member without this will segfault!

Variables

audio
AudioPcmOutThread audio;

You must override wantAudio and return true for this to be valid;

joysticks
JoystickUpdate[4] joysticks;

These functions help you handle user input. It offers polling functions for keyboard, mouse, joystick, and virtual controller input.

Suggestion Box / Bug Report