/**
 * Copyright (c) 2021 Dominic Masters
 * 
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */

#pragma once
#include "../libs.h"
#include "../util/rand.h"
#include "../input/input.h"
#include "../epoch/epoch.h"
#include "../display/render.h"

typedef struct {
  /** Name of the game */
  char *name;

  /** Time Manager for the game */
  epoch_t time;

  /** Render Manager for the game */
  render_t render;

  /** Input Manager for the game */
  input_t input;
} engine_t;

/**
 * Initializes the provided engine. This will initialize all of the various
 * managers for the game to use.
 * 
 * @param engine Engine to initialize.
 */
void engineInit(engine_t *engine);

/**
 * Updates the given engine at the start of a frame.
 * 
 * @param engine Engine that is being updated
 * @param delta Delta tick provided by the game's platform.
 */
void engineUpdateStart(engine_t *engine, float delta);

/**
 * Updates the given engine at the end of a frame.
 * 
 * @param engine Engine to update. 
 */
bool engineUpdateEnd(engine_t *engine);

/**
 * Cleanup the engine context.
 * 
 * @param engine Engine to clean up.
 */
void engineDispose(engine_t *engine);