Files
dusk/archive/dusk/game.h
2025-08-20 19:18:38 -05:00

49 lines
1.3 KiB
C

/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "dusk.h"
typedef struct {
bool_t running;
} game_t;
extern game_t GAME;
/**
* Initializes the game, this should be called before any other game functions.
* This should be called by the parent platform at a time that it deems
* appropriate. Any game systems cannot be used until this function has
* been called.
*
* By the point this is called, we expect;
* - Rendering has initialized and is ready to draw.
* - Input has been initialized and is ready to be read.
* - If your system handles time dynamically, it should be ready to be used.
*
* The systems called (in order) are;
* - Console.
* - Input system (Not the platforms input, but the game's input system).
* - Time system (if applicable).
* - Event System
* - UI Systems.
* - Gameplay systems.
*/
void gameInit(void);
/**
* Asks the game to update, this will not do any drawing and should be called
* in the main loop of the system, ideally either after or before the rendering
* has occured.
*/
void gameUpdate(void);
/**
* Cleans up resources used by the game, rendering really should still be
* available at this point because we want to cleanup nicely.
*/
void gameDispose(void);