Game

The base system to manage a game This class handles the following: * Spawning a GameWindow * Starting an event loop for input * Creating an audio subsystem * Fixed timestep updates * Content management pipeline creation

Basicly, extend this class to create a game.

Constructors

this
this(bool audio, bool eventSystem)

Create a new game instance.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

Draw
void Draw(GameTime gameTime)

Run a draw iteration

FixedUpdate
void FixedUpdate(double fixedDelta)

Run a fixed time step update

Init
void Init()

Initialize core game variables and the like.

LoadContent
void LoadContent()

Load game assets from disk, etc.

PollEvents
void PollEvents()

Poll system events

Prepare
void Prepare(bool waitForVisible)

Prepare the backend for use.

Quit
void Quit()

Quits the game

Run
void Run()

Start/run the game

RunOne
bool RunOne()

Run a single frame of the game

UnloadContent
void UnloadContent()

Unload game assets, etc.

Update
void Update(GameTime gameTime)

Run an update iteration

forceWindowChange
void forceWindowChange(win.Window newWindow)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

AudioEnabled
bool AudioEnabled [@property getter]
bool AudioEnabled [@property setter]

Wether the audio backend is enabled.

DeltaTime
GameTimeSpan DeltaTime [@property getter]

How much time since last frame

FixedFrametime
double FixedFrametime [@property getter]

How many miliseconds since the last frame was drawn

Frametime
double Frametime [@property getter]

How many miliseconds since the last frame was drawn

IsGameLagging
bool IsGameLagging [@property getter]

Returns true if the game is running slowly

ShowCursor
bool ShowCursor [@property getter]
bool ShowCursor [@property setter]

Wether the system cursor should be shown while inside the game window.

TotalTime
GameTimeSpan TotalTime [@property getter]

How much time since game started

Window
win.Window Window [@property getter]

The window the game is being rendered to

Variables

Content
ContentManager Content;
Undocumented in source.
OnWindowSizeChanged
Event!GameResizeEventArgs OnWindowSizeChanged;

Event raised when the window changes its size

spriteBatch
SpriteBatch spriteBatch;
Undocumented in source.
window
win.Window window;
Undocumented in source.

Meta