Loading...
Searching...
No Matches
engine.h
Go to the documentation of this file.
#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_
bool.h
ARC_Bool
#define ARC_Bool
Definition bool.h:10
ARC_Engine_RunUncapped
void ARC_Engine_RunUncapped(ARC_EngineData *data)
runs ARC_Engine with an uncapped framerate
ARC_EngineData
struct ARC_EngineData ARC_EngineData
predefien ARC_EngineData so as not to get circular reference
Definition renderer.h:11
ARC_EngineData_Create
void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanFn, ARC_Point windowSize)
ARC_EngineData_Destroy
void ARC_EngineData_Destroy(ARC_EngineData *data)
handler.h
ARC_Handler_CleanDataFn
void(* ARC_Handler_CleanDataFn)(void *data)
a function that will be used during destruction of trash vector
Definition handler.h:40
ARC_Handler
struct ARC_Handler ARC_Handler
a handler type
Definition handler.h:14
input.h
ARC_Input
struct ARC_Input ARC_Input
predefien ARC_Input so as not to get circular reference
Definition input.h:17
keyboard.h
ARC_Keyboard
struct ARC_Keyboard ARC_Keyboard
Definition keyboard.h:15
mouse.h
ARC_Mouse
struct ARC_Mouse ARC_Mouse
Definition mouse.h:16
point.h
renderer.h
ARC_Renderer
struct ARC_RendererType ARC_Renderer
Definition renderer.h:16
ARC_EngineData
Definition engine.h:17
ARC_EngineData::windowSize
ARC_Point windowSize
Definition engine.h:27
ARC_EngineData::input
ARC_Input * input
Definition engine.h:21
ARC_EngineData::keyboard
ARC_Keyboard * keyboard
Definition engine.h:23
ARC_EngineData::running
ARC_Bool running
Definition engine.h:26
ARC_EngineData::state
ARC_Handler * state
Definition engine.h:20
ARC_EngineData::window
ARC_Window * window
Definition engine.h:18
ARC_EngineData::renderer
ARC_Renderer * renderer
Definition engine.h:19
ARC_EngineData::mouse
ARC_Mouse * mouse
Definition engine.h:22
ARC_EngineData::dt
double dt
Definition engine.h:25
ARC_Point
Definition point.h:10
window.h
ARC_Window
struct ARC_WindowType ARC_Window
Definition window.h:13