Table of Contents

Class Game

Namespace
Axolotl2D
Assembly
Axolotl2D.dll

Represents the base game class for Axolotl2D.

public abstract class Game : IDisposable
Inheritance
Game
Implements
Inherited Members

Constructors

Game(IServiceProvider, int, int)

Construct a new game.

public Game(IServiceProvider serviceProvider, int maxDrawRate = 120, int maxUpdateRate = 120)

Parameters

serviceProvider IServiceProvider

Service provider to relay.

maxDrawRate int

Maximum frame rate.

maxUpdateRate int

Maximum update rate.

Properties

ClearColor

Represents the clear color of the game.

public Color ClearColor { get; set; }

Property Value

Color

CurrentFramerate

Represents the current framerate of the game.

public double CurrentFramerate { get; }

Property Value

double

Title

The window title.

public string Title { get; set; }

Property Value

string

Viewport

The current Viewport of the game.

public Vector2 Viewport { get; set; }

Property Value

Vector2

Methods

Cleanup()

Event that gets called when the game attempts to clean up.

protected abstract void Cleanup()

Dispose()

Disposes the game.

public void Dispose()

~Game()

Finalizer for the game.

protected ~Game()

GetKeyboard()

Gets the keyboard input helper.

public IKeyboard? GetKeyboard()

Returns

IKeyboard

Keyboard input helper.

GetMouse()

Gets the mouse input helper.

public IMouse? GetMouse()

Returns

IMouse

Mouse input helper.

Events

OnDraw

Called when the game draws.

public event Game.DrawDelegate? OnDraw

Event Type

Game.DrawDelegate

OnLoad

Called when the game loads.

public event Game.LoadDelegate? OnLoad

Event Type

Game.LoadDelegate

OnResize

Called when the game window resizes.

public event Game.ResizeDelegate? OnResize

Event Type

Game.ResizeDelegate

OnUpdate

Called when the game updates.

public event Game.UpdateDelegate? OnUpdate

Event Type

Game.UpdateDelegate