-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrames.h
More file actions
60 lines (57 loc) · 1.94 KB
/
Frames.h
File metadata and controls
60 lines (57 loc) · 1.94 KB
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
50
51
52
53
54
55
56
57
58
59
60
#pragma once
#include <SFML\Graphics.hpp>
#include <iostream>
#include <sstream>
class Framerate
{
private:
sf::Clock mcl_FPSclock;
sf::Clock mcl_FrameTime;
float mfl_FrameTime;
int mi_count;
int mi_countact;
bool mi_shouldDraw;
sf::Text mt_FPS;
std::stringstream mss_ss;
std::string ms_showFPS;
public:
Framerate();
~Framerate();
/************************************************/
/* function: countFPS */
/* description: counts the frames per seconds */
/* */
/* param: RenderWindow */
/* return: */
/* Autor: Moritz Weichert */
/************************************************/
void countFPS(sf::RenderWindow& win);
/************************************************/
/* function: showhideFPS */
/* description: show or hide the fpsdisplay */
/* */
/* param: RenderWindow */
/* return: */
/* Autor: Moritz Weichert */
/************************************************/
void showhideFPS(sf::RenderWindow &win,sf::Event &Event);
/************************************************/
/* function: start/endPoint() */
/* description: stops the time between these */
/* 2 functions */
/* param: */
/* return: */
/* Autor: Moritz Weichert */
/************************************************/
void startPoint();
void endPoint();
/************************************************/
/* function: getFrameTime */
/* description: returns the Frametime */
/* */
/* param: */
/* return: float */
/* Autor: Moritz Weichert */
/************************************************/
float getFrameTime();
};