re-enabled dt using SDL for school project, need to remove this or replace with a non library version

This commit is contained in:
herbglitch 2024-12-12 19:44:05 -07:00
parent 37259a3ac3
commit c9e5cb2d11

View file

@ -11,6 +11,9 @@
#include "arc/std/errno.h"
#include "arc/std/handler.h"
//TODO: remove this
#include <SDL.h>
void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanFn, ARC_Point windowSize){
*data = (ARC_EngineData *)malloc(sizeof(ARC_EngineData));
(*data)->window = NULL;
@ -58,13 +61,13 @@ void ARC_Engine_RunUncapped(ARC_EngineData *data){
return;
}
// double lastTime = 0, currentTime;
double lastTime = 0, currentTime;
data->running = ARC_True;
while(data->running){
// currentTime = SDL_GetTicks();
// data->dt = currentTime - lastTime;
// lastTime = currentTime;
currentTime = SDL_GetTicks();
data->dt = currentTime - lastTime;
lastTime = currentTime;
data->running = ARC_Input_Update(data->input);