[OpenGL] Framerate limit in eglSwapBuffers
@@ -74,6 +74,12 @@ EXPORT_C_(unsigned int) eglSwapBuffers( void* dpy, void* surf)
imgui_render(width, height);
//std::cerr << "\t" << width << " x " << height << "\n";
+ using namespace std::chrono_literals;
+ if (fps_limit_stats.targetFrameTime > 0s){
+ fps_limit_stats.frameStart = Clock::now();
+ FpsLimiter(fps_limit_stats);
+ fps_limit_stats.frameEnd = Clock::now();
+ }
}
return pfn_eglSwapBuffers(dpy, surf);
