Dive into C++11 - [2] - Frametime, FPS, constexpr, uniform initialization
http://vittorioromeo.info
- Check out my website!
Source: https://github.com/SuperV1234/Tutorials
Hello everyone!
Here's the second episode of my game-development series, `Dive into C++11`.
In this episode we will learn more about two previously mentioned new awesome C++11 features: "constexpr" and "uniform initialization syntax".
Most importantly, we will also deal with a very big issue that every game developer must face: FPS/frametime, and how to avoid the game from behaving differently on slower/faster machines.
In addition, we'll also briefly learn about "const-correctness" and using the "noexcept" keyword.
We will analyze the "time-slice" method to allow the game to run smoothly and consistently on every machine.
In the last code segment, we will also "refactor" our code by creating a `Game` class, making our source much easier to read and maintain.
0:00 - constexpr addendum
3:20 - uniform intialization syntax addendum
10:10 - 1st segment (const-correctness, noexcept, event polling)
19:40 - 2nd segment (FPS and Frametime management)
34:15 - 4th segment ("time-slicing" for consistent logic with any FPS)
45:10 - 5th segment (refactoring)
The intended audience for this tutorial/screencast are people who have some experience with C++ in general, and who watched the previous episodes.
I greatly appreciate comments and criticism, and ideas for future videos/tutorials.
Feel free to fork the game's source code at
https://github.com/SuperV1234/Tutorials
and expand upon it: I may feature the best forks in a future video, if people enjoy the idea.
Thanks for watching!
---
http://vittorioromeo.info
---
You can find SFML 2.1 here: http://sfml-dev.org/
More on the framerate issue:
http://www.koonsolo.com/news/dewitters-gameloop/
http://fabiensanglard.net/timer_and_framerate/