Project

main project class used for the game as a whole

Members

Functions

AddScene
void AddScene(Scene scene)

adds a scene to the project scene array

GetGameDirectory
string GetGameDirectory()

gets the directory the game executable is in

GetResolution
Vec2!int GetResolution()

gets the resolution of the window

Init
void Init()

called once at the start

InitText
void InitText()

initialises the text library

InitWindow
void InitWindow(string name, int w, int h)

creates the window

KeyPressed
bool KeyPressed(SDL_Scancode key)

checks if a key is pressed

LoadFontData
void LoadFontData(ubyte[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
LoadFontFile
void LoadFontFile(string path, int pointSize)
Undocumented in source. Be warned that the author may not have intended to support it.
Run
void Run()

runs the game

SetResolution
void SetResolution(uint w, uint h)

sets the logical resolution of the window

SetScene
void SetScene(Scene scene)

sets the current scene to a scene from the project scene array

SetScene
void SetScene(size_t index)

sets the current scene to a scene from the project scene array

Variables

currentScene
Scene currentScene;
Undocumented in source.
font
TTF_Font* font;
Undocumented in source.
frames
ulong frames;

how many frames have passed since the game was started

logicalRes
Vec2!int logicalRes;

DON'T MODIFY!!!!

mousePos
Vec2!int mousePos;
Undocumented in source.
renderer
SDL_Renderer* renderer;
Undocumented in source.
running
bool running;

while true, update functions are called

scenes
Scene[] scenes;
Undocumented in source.
usingLogicalRes
bool usingLogicalRes;

DON'T MODIFY!!!!

window
SDL_Window* window;
Undocumented in source.

Meta