SFML Framerate (FPS) calculation and frame rate limiting

Опубликовано: 17 Февраль 2022
на канале: Mike Shah
4,518
112

►Full Series Playlist: SFML Playlist:    • SFML - Simple Fast Media Library  
►Find full courses on: https://courses.mshah.io/
►Join as Member to Support the channel:    / @mikeshah  

►Lesson Description: In this lesson I show you how to calculate the framerate for an application. I talk about the problem with not limiting the framerate from our previous application (i.e. the sprite will move too fast on different machines), and we see how to correct it using SFML's built-in frame limiting function. You will also understand after this lesson how to compute and limit the framerate yourself, if you'd like to build your own utility.

NOTE: It's probably worth providing an assertion to ensure currentTime does not return 0.
NOTE: If you also do not see a change in framerate with the setFramerateLimit function, you may have to disable vertical sync.

00:00 Introduction and framerate defined
1:00 Illustrating the problem--demo
1:54 Framerate calculation explanation
4:00 sf::clock and sf::time classes in SFML
4:40 Elapsed time calculation
5:40 Implementation of calculating frames per second calculation
9:00 Limit frame rate (setFramerateLimit)
11:57 Conclusion

►YouTube Channel:    / mikeshah  
►Please like and subscribe to help the channel!
►Join our free community: https://courses.mshah.io/communities/...


Смотрите видео SFML Framerate (FPS) calculation and frame rate limiting онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Mike Shah 17 Февраль 2022. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 4,518 раз и оно понравилось 112 посетителям.