Added a safer delay period which helps with CPU
@@ -45,7 +45,7 @@ int main(int argc, char* args[])
goto cleanup;
}
- ENGINE engine;
+ ENGINE engine = {0};
result = ENGINE_init(&engine);
if (result == EXIT_FAILURE) {
goto cleanup;
@@ -121,6 +121,9 @@ int main(int argc, char* args[])
lag -= MS_PER_FRAME;
attempts += 1;
}
+ if (lag > 0) {
+ SDL_Delay((uint32_t)lag);
+ }
// render();
wrenSetSlotHandle(vm, 0, gameClass);
