Dawn/src/game/game.c

34 lines
736 B
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "game.h"
bool gameInit(game_t *game) {
// Init the engine and the rendering pipeline
engineInit(&game->engine);
// Send off to the game instance
return gameInstanceInit(game);
}
bool gameUpdate(game_t *game, float platformDelta) {
// Let the engine do its thing.
engineUpdateStart(&game->engine, platformDelta);
// Hand off to the game to update
gameInstanceUpdate(game);
// Hand back to the engine.
return engineUpdateEnd(&game->engine);
}
void gameDispose(game_t *game) {
// Cleanup the game
gameInstanceDispose(game);
engineDispose(&game->engine);
}