updated handler and fixed state in the process
This commit is contained in:
parent
55e8c44221
commit
5a0d1af942
5 changed files with 24 additions and 18 deletions
|
|
@ -22,13 +22,12 @@ typedef struct ARC_EngineData {
|
|||
double dt;
|
||||
uint32_t running;
|
||||
ARC_Point windowSize;
|
||||
|
||||
ARC_Handler_CleanDataFn cleanfn;
|
||||
} ARC_EngineData;
|
||||
|
||||
//NOTE: most work below is temp, and will change once I figure out a better way to write this header
|
||||
|
||||
void ARC_EngineData_Create(ARC_EngineData **data);
|
||||
void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanfn);
|
||||
|
||||
void ARC_EngineData_Destroy(ARC_EngineData *data);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,13 +42,17 @@ typedef void (* ARC_Handler_CleanDataFn)(void *data);
|
|||
* @brief creates ARC_Handler type
|
||||
*
|
||||
* @param config ARC_Handler to initialize
|
||||
* @param cleanfn function to clean data in handler
|
||||
* can be null
|
||||
*/
|
||||
void ARC_Handler_Create(ARC_Handler **handler);
|
||||
void ARC_Handler_Create(ARC_Handler **handler, ARC_Handler_CleanDataFn cleanfn);
|
||||
|
||||
/**
|
||||
* @brief destroyes ARC_Handler type
|
||||
*
|
||||
* @param handler ARC_Handler to destory
|
||||
*/
|
||||
void ARC_Handler_Destroy(ARC_Handler *handler, ARC_Handler_CleanDataFn cleanfn);
|
||||
void ARC_Handler_Destroy(ARC_Handler *handler);
|
||||
|
||||
/**
|
||||
* @brief adds data to handler
|
||||
|
|
@ -103,10 +107,8 @@ void ARC_Handler_Clear(ARC_Handler *handler);
|
|||
* @note cleanfn's main purpose is to help manage memory
|
||||
*
|
||||
* @param handler ARC_Handler to remove trash from
|
||||
* @param cleanfn user provided function to run on trash before clearing from trash vector
|
||||
* can be null
|
||||
*/
|
||||
void ARC_Handler_Clean(ARC_Handler *handler, ARC_Handler_CleanDataFn cleanfn);
|
||||
void ARC_Handler_Clean(ARC_Handler *handler);
|
||||
|
||||
/**
|
||||
* @brief gets size of vector
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue