added 3dengfx into the repo, probably not the correct version for this
[summerhack] / src / 3dengfx / src / common / fps_counter.h
1 #ifndef _FPS_COUNTER_H_
2 #define _FPS_COUNTER_H_
3
4 typedef struct fps_counter {
5         unsigned long sample_interval;
6         unsigned long sample_start_time;
7         unsigned long frame_count;
8         float fps;
9 } fps_counter;
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif  /* __cplusplus */
14
15 void fps_start(fps_counter *fpsc, unsigned long time, unsigned long sample_interval);
16 int fps_frame_proc(fps_counter *fpsc, unsigned long time);
17 const char *fps_get_frame_rate_str(fps_counter *fpsc);
18
19 #define fps_get_frame_rate(fpsc) (fpsc)->fps
20
21 #ifdef __cplusplus
22 }
23 #endif  /* __cplusplus */
24
25 #endif  /* _FPS_COUNTER_H_ */