-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathguifps.h
49 lines (36 loc) · 956 Bytes
/
guifps.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* Copyright 2011 Pyarelal Knowles, under GNU LGPL (see LICENCE.txt) */
//since quickglut is deprecated, this will be the new FPS display, built on top of quickgui
#ifndef GUI_FPS
#define GUI_FPS
#define GUIFPS_NUM_SAMPLES 20
#define GUIFPS_MIN_TIME 0.6
#define GUIFPS_VERTICAL_BARS 5
#define NINEBOX_BACKGROUND "graph"
#include "quickgui.h"
namespace QG
{
extern NineBoxPool fpsgraphBox;
struct FPSGraph : public Widget
{
bool gotNewSample; //true if last update() took a tpf sample
bool print;
float time;
float frames;
float fpsLast;
float tpfLast;
float tpfAverage;
float tpfMedian;
float tpfMaximum;
float tpfMinimum;
float heightScale;
float times[GUIFPS_NUM_SAMPLES]; //cyclical list
int currentSample;
FPSGraph();
virtual ~FPSGraph();
void updateStats();
void update(float dt); //the interface
virtual void update();
virtual void drawContent(mat44 mat);
};
}
#endif