openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
763 stars 375 forks source link

Enhance frame rate calculations with double and SDL performance counter #1843

Closed MAJigsaw77 closed 1 month ago

MAJigsaw77 commented 1 month ago
NeeEoo commented 1 month ago

Just Fyi: SDL_AddTimer takes a uint32 (ms) and not a double, so this still causes the framerate to be slightly off. A possible fix would be using std::chrono

dimensionscape commented 1 month ago

I appreciate the initiative, but this doesn't resolve any problems, and increases cpu usage. We are going to handle this in a very different way in the next(probably) version of lime.

NeeEoo commented 1 month ago

When sdl 3 is implemented we can use SDL_GetTicksNS to get nanoseconds instead and its in Uint64

dimensionscape commented 1 month ago

The plan is to stop using SDL to construct the main loop.

When sdl 3 is implemented we can use SDL_GetTicksNS to get nanoseconds instead and its in Uint64