removed pointless pointers in rectange, reset background clear color, fixed entity, and added some state functions
This commit is contained in:
parent
dd1f3ca3e0
commit
bd7e3212da
12 changed files with 161 additions and 86 deletions
|
|
@ -12,15 +12,17 @@ extern "C" {
|
|||
#include "arc/input/keyboard.h"
|
||||
#include "arc/math/point.h"
|
||||
#include "arc/std/bool.h"
|
||||
#include "arc/std/entity.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;
|
||||
ARC_Window *window;
|
||||
ARC_Renderer *renderer;
|
||||
ARC_Handler *state;
|
||||
ARC_Input *input;
|
||||
ARC_Mouse *mouse;
|
||||
ARC_Keyboard *keyboard;
|
||||
ARC_EntitySystem *entitySystem;
|
||||
|
||||
double dt;
|
||||
ARC_Bool running;
|
||||
|
|
@ -34,7 +36,7 @@ typedef struct ARC_EngineData {
|
|||
* @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);
|
||||
void ARC_EngineData_Create(ARC_EngineData **data, ARC_Point windowSize);
|
||||
|
||||
/**
|
||||
* @breif destroys an ARC_EngineData type
|
||||
|
|
|
|||
|
|
@ -5,20 +5,54 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
typedef void (* ARC_State_UpdateFn)(void *data);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
typedef void (* ARC_State_RenderFn)(void *data);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
typedef void (* ARC_State_DestroyDataFn)(void *data);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
typedef struct ARC_State {
|
||||
ARC_State_UpdateFn updateFn;
|
||||
ARC_State_RenderFn renderFn;
|
||||
|
||||
void *data;
|
||||
ARC_State_DestroyDataFn *destroyDataFn;
|
||||
} ARC_State;
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
void ARC_State_Create(ARC_State **state, ARC_State_UpdateFn updateFn, ARC_State_RenderFn renderFn, void *data, ARC_State_DestroyDataFn *destroyDataFn);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
void ARC_State_Destroy(ARC_State *state);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
void ARC_State_Update(void *data);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
void ARC_State_Render(void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ARC_ENGINE_STATE_H_
|
||||
#endif // ARC_ENGINE_STATE_H_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue