OpenPolygon  1.0.0
OpenPolygon is a Rendering Engine
tickmanager.h
1 /*
2  Copyright (C) 2014 - 2016 Mutzii
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 */
18 #ifndef TICKMANAGER_H
19 #define TICKMANAGER_H
20 
21 #include "index.h"
22 #include "display.h"
23 
24 namespace Engine
25 {
26  struct Ticks
27  {
28  float render_ticks; //Tick Rate: Render Thread
29  float input_ticks; //Tick Rate: Input Thread
30  float logic_ticks; //Tick Rate: Logic Thread
31  float fps; //Render frames per second
32  float lps; //Logic frames per second
33  };
34 
35  using TicksMap = std::map< std::string , Ticks* >;
36 
38  {
39  public:
40  TickManager();
41  ~TickManager();
42 
48  void addTicks( OpenPolygonDisplay * display );
49 
55  Ticks * getTicks( OpenPolygonDisplay * display );
56 
57  void setLPS( const std::string & display_name , float value );
58  void setFPS( const std::string & display_name , float value );
59 
60  float getLPS( const std::string & display_name );
61  float getFPS( const std::string & display_name );
62 
63  private:
64 
65  TicksMap m_ticks_map;
66  };
67 }
68 #endif // TICKMANAGER_H
Definition: tickmanager.h:26
void addTicks(OpenPolygonDisplay *display)
addTicks
Definition: Tickmanager.cpp:32
Definition: element.h:23
Ticks * getTicks(OpenPolygonDisplay *display)
getTicks
Definition: Tickmanager.cpp:44
Definition: tickmanager.h:37
The OpenPolygonDisplay - display abstract class.
Definition: display.h:55