Answer the question
In order to leave comments, you need to log in
How do I know the FPS in my application?
Hello, dear users of the site toster.ru. I have a question, how to calculate the FPS of my application and limit it (using C++ and SDL2)?
Please do not just give the code, but explain how it works.
Answer the question
In order to leave comments, you need to log in
In this video tutorial (in broken English) the author explains how to control FPS in SDL. With sources.
Or maybe even dance?
Write how you suppose it can be done, what did not work out - and they will help you!
The simplest thing is to draw by time. Start a timer that knows when to draw next time, ask it with some frequency if the time to draw has come, if yes - draw and set the next timestamp, if not - do nothing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question