Game Develop C++ Platform: BaseProfiler.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
BaseProfiler.h
Go to the documentation of this file.
1
6 #if defined(GD_IDE_ONLY)
7
8 #ifndef BASEPROFILER_H
9 #define BASEPROFILER_H
10 #include <vector>
11 #include <boost/weak_ptr.hpp>
12 #include <SFML/System.hpp>
13 #include "GDCpp/profile.h"
14 namespace gd { class BaseEvent; }
15
19 class ProfileLink
20 {
21 public:
22 ProfileLink() : time(0) {};
23
24 void Reset();
25 void Stop();
26 unsigned long int GetTime() const { return time; }
27
28 btClock profileClock;
29 unsigned long int time;
30 boost::weak_ptr<gd::BaseEvent> originalEvent;
31 };
32
36 class GD_API BaseProfiler
37 {
38 public:
39 BaseProfiler();
40 virtual ~BaseProfiler() {};
41
42 bool profilingActivated;
43
44 unsigned long int lastEventsTime;
45 unsigned long int lastRenderingTime;
46 unsigned long int totalSceneTime;
47 unsigned long int totalEventsTime;
48
49 btClock eventsClock;
50 btClock renderingClock;
51
52 std::vector<ProfileLink> profileEventsInformation;
53
54 void Update();
55 void Reset();
56
57 protected:
58 sf::Uint32 stepTime;
59
63 virtual void UpdateGUI() = 0;
64 private:
65 sf::Clock stepClock;
66 };
67
68 #endif // BASEPROFILER_H
69 #endif
70