The OpenD Programming Language

GameHelperBase

This is the base class for your game. Create a class based on this, then pass it to runGame.

Members

Functions

designFps
int designFps()

Returns the number of game updates per second your game is designed for.

drawFrame
deprecated void drawFrame(float interpolateToNextFrame)

Implement this to draw.

firstScreen
GameScreenBase firstScreen()

Returns the first screen of your game.

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.

multithreadCompatible
bool multithreadCompatible()

Override this and return true if you are compatible with separate render and update threads.

showScreen
void showScreen(Screen cs, GameScreenBase transition)

Shows the given screen, making it actively responsible for drawing and updating, optionally through the given transition effect.

update
deprecated bool update()

Implement this to update your game state by a single fixed timestep. You should check for user input state here.

wantAudio
bool wantAudio()

Override this and return true to initialize the audio system. If you return true here, the audio member can be used.

Variables

audio
AudioOutputThread 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.

snes
VirtualController snes;

Meta