Krig Game Engine
Loading...
Searching...
No Matches
gametimer.h
1
2// Description : Class for handling game timing and delay //
4#ifndef _GAME_TIMER_H_
5#define _GAME_TIMER_H_
6
7#include "constants.h"
8
9#ifdef _WIN32
10 #include <windows.h>
11#endif
12
13// On non-Windows, alias LARGE_INTEGER to long to share member declarations
14// with the Windows path without requiring platform ifdefs at each use site.
15#define LARGE_INTEGER long
16#define MAX_FPS 30.0f
17
18class GameTimer {
19 public:
20 bool init();
21
28 float getElapsedSeconds();
29
36 float getFPS();
37
38 private:
39 long m_startTime;
40
41#ifdef _WIN32
42 LARGE_INTEGER m_ticksPerSecond;
43#endif
44
45 float fps;
46};
47
48#endif
Definition gametimer.h:18
float getFPS()
Definition gametimer.cpp:75
float getElapsedSeconds()
Definition gametimer.cpp:34