Dawn/src/game/game.h
2021-09-25 11:29:23 -07:00

50 lines
1.2 KiB
C

// Copyright (c) 2021 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "../libs.h"
#include "../engine/engine.h"
#include "../locale/language.h"
/** Describes the current game */
#if SETTING_GAME == SETTING_GAME_POKER
#include "poker/game.h"
typedef pokergame_t game_t;
#define GAME_INIT poekrGameInit
#define GAME_UPDATE pokerGameUpdate
#define GAME_DISPOSE pokerGameDispose
#elif SETTING_GAME == SETTING_GAME_DAWN
#include "dawn/game.h"
typedef dawngame_t game_t;
#elif SETTING_GAME == SETTING_GAME_SANDBOX
#include "sandbox/sandboxscene.h"
typedef sandboxscene_t game_t;
#define GAME_INIT sandboxSceneInit
#define GAME_UPDATE sandboxSceneUpdate
#define GAME_DISPOSE sandboxSceneDispose
#endif
/**
* Initialize the game context.
*
* @return True if successful, otherwise false.
*/
bool gameInit(game_t *game);
/**
* Tick the main game loop.
*
* @param platformDelta The platform tick delta between the last render.
* @return True if successful, false if safe exit requested..
*/
bool gameUpdate(game_t *game, float platformDelta);
/**
* Cleanup the game instance.
*/
void gameDispose(game_t *game);