Leviathan  0.8.0.0
Leviathan game engine
RenderingStatistics.h
Go to the documentation of this file.
1 // Leviathan Game Engine
2 // Copyright (c) 2012-2019 Henri Hyyryläinen
3 #pragma once
4 #include "Define.h"
5 // ------------------------------------ //
6 #include "../ForwardDeclarations.h"
7 #include <cstddef>
8 #include <vector>
9 
10 namespace Leviathan {
11 
16 public:
19 
21  DLLEXPORT void RenderingEnd();
22 
23  DLLEXPORT bool CanRenderNow(int maxfps, int& TimeSinceLastFrame);
24 
25  DLLEXPORT void ReportStats(DataStore* dstore);
26 
27 private:
28  void HalfMinuteMark();
29  void SecondMark();
30 
31  static void MakeSureHasEnoughRoom(std::vector<int>& tarvec, const size_t& accessspot);
32 
33  // ------------------------------------ //
34  int64_t HalfMinuteStartTime;
35  int64_t SecondStartTime;
36  int64_t RenderingStartTime;
37  int64_t RenderingEndTime;
38  // measured values //
39  int Frames;
40 
41  int FPS;
42  int RenderMCRSeconds;
43 
44  int MinFPS;
45  int MaxFPS;
46  int AverageFps;
47 
48  int MaxFrameTime;
49  int MinFrameTime;
50  int AverageRenderTime;
51 
52  int DoubtfulCancel;
53 
54  bool IsFirstFrame;
55 
56  // stored values //
57  std::vector<int> LastMinuteFPS;
58  size_t LastMinuteFPSPos;
59 
60  std::vector<int> LastMinuteRenderTimes;
61  size_t LastMinuteRenderTimesPos;
62 
63 
64  bool EraseOld;
65 };
66 
67 } // namespace Leviathan
#define DLLEXPORT
Definition: Include.h:84
DLLEXPORT void ReportStats(DataStore *dstore)
DLLEXPORT bool CanRenderNow(int maxfps, int &TimeSinceLastFrame)
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12