le3d - LightEngine 3D
A straightforward C++ 3D software engine for real-time graphics
timing.h
Go to the documentation of this file.
1 
34 #ifndef LE_TIMING_H
35 #define LE_TIMING_H
36 
37 #include <stdint.h>
38 
39 /*****************************************************************************/
44 class LeTiming {
45 public:
46  LeTiming();
47  ~LeTiming();
48 
49  void setup(int targetFPS);
50 
51  void firstFrame();
52  void lastFrame();
53 
54  bool isNextFrame();
55  void waitNextFrame();
56 
57  float fps;
60 private:
61  int64_t countsPerSec;
62  int64_t countsPerFrame;
63  int64_t lastCounter;
65  void display();
66 };
67 
68 extern LeTiming timing;
69 
70 #endif // LE_TIMING_H
void setup(int targetFPS)
Configure the frame timing system.
Definition: timing_win.cpp:66
void firstFrame()
Mark the time of the first frame.
Definition: timing_win.cpp:82
void lastFrame()
Mark the time of the last frame.
Definition: timing_win.cpp:95
float fps
Definition: timing.h:57
LeTiming timing
Definition: timing_win.cpp:45
~LeTiming()
Definition: timing_win.cpp:56
bool enableDisplay
Definition: timing.h:58
void waitNextFrame()
Wait until it is time to display the next frame.
Definition: timing_win.cpp:125
bool isNextFrame()
Is it the time to display the next frame?
Definition: timing_win.cpp:106
LeTiming()
Definition: timing_win.cpp:48
Abstract OS native time measurement & process yielding.
Definition: timing.h:44