-
-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there really no way to limit fps? #749
Comments
I don't think there is any automatic way, but it should not be too hard to use |
Yeah, this seems to be the only way... I don't think sleep() works in WASM, though. |
A better way to do this (if fps is too high) is to keep rendering without updating physics, so for example you render 2 frames for 1 physics update. And if fps is too low, you do the opposite - update physics multiple times every frame. |
Oh, so I could have a couple fps ranges (58-62, 68-72, 88-92), for instance, and modify the processes based on checks against those? That sounds like it could work. |
You can't use std::thread::sleep!
You can only set the swap interval.
The swap interval is platform specific and requires additional OpenGL extensions to support it. Many questions about this have been asked before, and my answer is the same for all of them. |
I am compiling my game to WASM and hosting it on itch.io, and I've noticed that the speed at which it runs is completely different depending on the refresh rate of the device I'm using. It runs fine on my computer, but runs way too fast on my Android with 90hz. Is there any sort of automatic way to lock the physics process to 60hz?
The text was updated successfully, but these errors were encountered: