#ifndef ARC_ENGINE_H_
#define ARC_ENGINE_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "arc/graphics/window.h"
#include "arc/graphics/renderer.h"
#include "arc/input/input.h"
#include "arc/input/mouse.h"
#include "arc/input/keyboard.h"
#include "arc/math/point.h"
#include "arc/std/bool.h"
#include "arc/std/handler.h"

typedef struct ARC_EngineData {
    ARC_Window   *window;
    ARC_Renderer *renderer;
    ARC_Handler  *state;
    ARC_Input    *input;
    ARC_Mouse    *mouse;
    ARC_Keyboard *keyboard;

    double dt;
    ARC_Bool running;
    ARC_Point windowSize;
} ARC_EngineData;

/**
 * @breif creates an ARC_EngineData type to be used when running an ARC_Engine
 *
 * @param data       the ARC_EngineData to create
 * @param cleanFn    the state cleanup function
 * @param windowSIze the size of window to create passed as an ARC_Point
*/
void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanFn, ARC_Point windowSize);

/**
 * @breif destroys an ARC_EngineData type
 *
 * @param data the ARC_EngineData to destroy
*/
void ARC_EngineData_Destroy(ARC_EngineData *data);

/**
 * @brief runs ARC_Engine with an uncapped framerate
 *
 * @note data must be created before this function
 * @note data should be destroyed after this function
 *
 * @param data engine data that will be used
 */
void ARC_Engine_RunUncapped(ARC_EngineData *data);

#ifdef __cplusplus
}
#endif

#endif // !ARC_ENGINE_H_
