2022-10-29 00:22:23 -06:00
|
|
|
#ifndef ARC_ENGINE_H_
|
|
|
|
|
#define ARC_ENGINE_H_
|
|
|
|
|
|
2022-10-29 16:08:41 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-10-29 00:22:23 -06:00
|
|
|
#include "arc/graphics/window.h"
|
|
|
|
|
#include "arc/graphics/renderer.h"
|
2024-05-20 03:46:04 -06:00
|
|
|
#include "arc/input/input.h"
|
2022-11-11 01:15:33 -07:00
|
|
|
#include "arc/input/mouse.h"
|
|
|
|
|
#include "arc/input/keyboard.h"
|
2022-12-13 15:50:24 -07:00
|
|
|
#include "arc/math/point.h"
|
2024-05-20 03:46:04 -06:00
|
|
|
#include "arc/std/bool.h"
|
2025-03-17 02:31:23 -06:00
|
|
|
#include "arc/std/entity.h"
|
2024-05-20 03:46:04 -06:00
|
|
|
#include "arc/std/handler.h"
|
2022-10-29 00:22:23 -06:00
|
|
|
|
|
|
|
|
typedef struct ARC_EngineData {
|
2025-03-17 02:31:23 -06:00
|
|
|
ARC_Window *window;
|
|
|
|
|
ARC_Renderer *renderer;
|
|
|
|
|
ARC_Handler *state;
|
|
|
|
|
ARC_Input *input;
|
|
|
|
|
ARC_Mouse *mouse;
|
|
|
|
|
ARC_Keyboard *keyboard;
|
|
|
|
|
ARC_EntitySystem *entitySystem;
|
2022-11-07 02:23:53 -07:00
|
|
|
|
|
|
|
|
double dt;
|
2024-05-20 03:46:04 -06:00
|
|
|
ARC_Bool running;
|
2022-12-13 15:50:24 -07:00
|
|
|
ARC_Point windowSize;
|
2022-10-29 00:22:23 -06:00
|
|
|
} ARC_EngineData;
|
|
|
|
|
|
2024-05-20 03:46:04 -06:00
|
|
|
/**
|
|
|
|
|
* @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
|
|
|
|
|
*/
|
2025-03-17 02:31:23 -06:00
|
|
|
void ARC_EngineData_Create(ARC_EngineData **data, ARC_Point windowSize);
|
2022-12-16 01:09:01 -07:00
|
|
|
|
2024-05-20 03:46:04 -06:00
|
|
|
/**
|
|
|
|
|
* @breif destroys an ARC_EngineData type
|
|
|
|
|
*
|
|
|
|
|
* @param data the ARC_EngineData to destroy
|
|
|
|
|
*/
|
2022-10-29 00:22:23 -06:00
|
|
|
void ARC_EngineData_Destroy(ARC_EngineData *data);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-05-20 03:46:04 -06:00
|
|
|
* @brief runs ARC_Engine with an uncapped framerate
|
|
|
|
|
*
|
|
|
|
|
* @note data must be created before this function
|
|
|
|
|
* @note data should be destroyed after this function
|
2022-10-29 00:22:23 -06:00
|
|
|
*
|
|
|
|
|
* @param data engine data that will be used
|
|
|
|
|
*/
|
2024-05-20 03:46:04 -06:00
|
|
|
void ARC_Engine_RunUncapped(ARC_EngineData *data);
|
2022-10-29 00:22:23 -06:00
|
|
|
|
2022-10-29 16:08:41 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-10-29 00:22:23 -06:00
|
|
|
#endif // !ARC_ENGINE_H_
|