TazGraph Project
v0.1.0
Loading...
Searching...
No Matches
TazGraphEngine
BaseFPSLimiter
BaseFPSLimiter.h
1
#pragma once
2
3
#include <SDL2/SDL.h>
4
5
class
BaseFPSLimiter
{
6
public
:
7
static
constexpr
int
fps_history_count = 100;
8
9
BaseFPSLimiter
();
10
11
void
init(
float
maxFPS);
12
13
void
setMaxFPS(
float
maxFPS);
14
15
void
begin();
16
17
//end will return the current FPS
18
float
end();
19
20
float
fpsHistory[fps_history_count] = { 0 };
21
int
fpsHistoryIndx = 0;
22
23
float
fps;
24
float
maxFPS;
25
Uint32 frameTime;
26
Uint32 startTicks;
27
28
void
setHistoryValue(
float
currentFPS);
29
30
private
:
31
void
calculateFPS();
32
33
};
BaseFPSLimiter
Definition
BaseFPSLimiter.h:5
Generated by
1.9.8