Fix crash
[ryzomcore.git] / snowballs2 / client / src / graph.h
blob19f6045c00c3bdf2b28fab82e23cff326717865d
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (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 Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef GRAPH_H
18 #define GRAPH_H
21 // Includes
24 #include <deque>
25 #include <string>
27 #include <nel/misc/rgba.h>
28 #include <nel/misc/time_nl.h>
30 namespace SBCLIENT {
33 // External classes
36 class CGraph
38 public:
39 std::string Name;
40 float X, Y, Width, Height;
41 NLMISC::CRGBA BackColor;
42 float MaxValue;
43 float Peak;
45 std::deque<float> Values;
47 NLMISC::TTime Quantum;
49 NLMISC::TTime CurrentQuantumStart;
51 CGraph (std::string name, float x, float y, float width, float height, NLMISC::CRGBA backColor, NLMISC::TTime quantum, float maxValue)
52 : Name(name), X(x), Y(y), Width(width), Height(height), BackColor(backColor), MaxValue(maxValue),
53 Peak(0.0f), Quantum(quantum), CurrentQuantumStart(NLMISC::CTime::getLocalTime())
57 void render ();
58 void addOneValue (float value = 0.0f);
59 void addValue (float value);
63 // External variables
66 extern CGraph FpsGraph;
67 extern CGraph SpfGraph;
68 extern CGraph DownloadGraph;
69 extern CGraph UploadGraph;
72 // External functions
75 void initGraph ();
76 void updateGraph ();
77 void releaseGraph ();
79 } /* namespace SBCLIENT */
81 #endif // GRAPH_H
83 /* End of graph.h */
85 /* end of file */