DDraceNetwork Docs
graph.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3
4#ifndef ENGINE_CLIENT_GRAPH_H
5#define ENGINE_CLIENT_GRAPH_H
6
7#include <base/color.h>
8
10
11#include <cstddef>
12
13class IGraphics;
14class ITextRender;
15
16class CGraph
17{
18private:
19 struct SEntry
20 {
21 int64_t m_Time;
22 float m_Value;
25 };
28 float m_Min, m_Max;
31
32public:
33 CGraph(int MaxEntries);
34
35 void Init(float Min, float Max);
36 void SetMin(float Min);
37 void SetMax(float Max);
38
39 void Scale(int64_t WantedTotalTime);
40 void Add(float Value, ColorRGBA Color = ColorRGBA(1.0f, 1.0f, 1.0f, 0.75f));
41 void InsertAt(int64_t Time, float Value, ColorRGBA Color = ColorRGBA(1.0f, 1.0f, 1.0f, 0.75f));
42 void Render(IGraphics *pGraphics, ITextRender *pTextRender, float x, float y, float w, float h, const char *pDescription);
43};
44
45#endif
Definition: ringbuffer.h:93
Definition: graph.h:17
void InsertAt(int64_t Time, float Value, ColorRGBA Color=ColorRGBA(1.0f, 1.0f, 1.0f, 0.75f))
Definition: graph.cpp:101
int64_t m_RenderedTotalTime
Definition: graph.h:27
float m_MaxRange
Definition: graph.h:29
void Render(IGraphics *pGraphics, ITextRender *pTextRender, float x, float y, float w, float h, const char *pDescription)
Definition: graph.cpp:129
void Init(float Min, float Max)
Definition: graph.cpp:14
void SetMin(float Min)
Definition: graph.cpp:23
SEntry * m_pFirstScaled
Definition: graph.h:26
CDynamicRingBuffer< SEntry > m_Entries
Definition: graph.h:30
void Scale(int64_t WantedTotalTime)
Definition: graph.cpp:33
void Add(float Value, ColorRGBA Color=ColorRGBA(1.0f, 1.0f, 1.0f, 0.75f))
Definition: graph.cpp:96
float m_MinRange
Definition: graph.h:29
CGraph(int MaxEntries)
Definition: graph.cpp:9
void SetMax(float Max)
Definition: graph.cpp:28
float m_Min
Definition: graph.h:28
float m_Max
Definition: graph.h:28
Definition: color.h:210
Definition: graphics.h:184
Definition: textrender.h:314
Definition: graph.h:20
bool m_ApplyColor
Definition: graph.h:24
ColorRGBA m_Color
Definition: graph.h:23
int64_t m_Time
Definition: graph.h:21
float m_Value
Definition: graph.h:22