Allolib  1.0
C++ Components For Interactive Multimedia
al_FPS.hpp
1 #ifndef INCLUDE_AL_FPS_HPP
2 #define INCLUDE_AL_FPS_HPP
3 
4 /* Keehong Youn, 2017, younkeehong@gmail.com
5  */
6 
7 #include "al/system/al_Time.hpp"
8 
9 namespace al {
10 
15 class FPS {
16  public:
17  al_nsec interval = 16666666ll; // 60 fps by default
18  al_nsec deltaTime;
19  al_nsec start_of_loop = 0;
20  double mFPSWanted = 60;
21  void fps(double f);
22  double fpsWanted();
23  double fps();
24  // get time
25  double sec();
26  double msec(); // millis
27  double dt(); // in nanos
28  double dt_sec(); // in seconds
29  void startFPS();
30  void tickFPS();
31 };
32 
33 } // namespace al
34 
35 #endif
FPS class.
Definition: al_FPS.hpp:15
Definition: al_App.hpp:23