Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
profilergraph.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2010-2018 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include <SColor.h>
8#include <deque>
9#include <utility>
10#include <IGUIFont.h>
11#include "profiler.h"
12
13namespace irr::video {
14 class IVideoDriver;
15}
16
17/* Profiler display */
19{
20private:
26 struct Meta
27 {
28 float min;
29 float max;
30 video::SColor color;
31 Meta(float initial = 0,
32 video::SColor color = video::SColor(255, 255, 255, 255)) :
33 min(initial),
34 max(initial), color(color)
35 {
36 }
37 };
38 std::deque<Piece> m_log;
39
40public:
41 u32 m_log_max_size = 200;
42
43 ProfilerGraph() = default;
44
45 void put(const Profiler::GraphValues &values);
46
47 void draw(s32 x_left, s32 y_bottom, video::IVideoDriver *driver,
48 gui::IGUIFont *font) const;
49};
Definition profilergraph.h:19
void put(const Profiler::GraphValues &values)
Definition profilergraph.cpp:11
std::deque< Piece > m_log
Definition profilergraph.h:38
ProfilerGraph()=default
void draw(s32 x_left, s32 y_bottom, video::IVideoDriver *driver, gui::IGUIFont *font) const
Definition profilergraph.cpp:19
u32 m_log_max_size
Definition profilergraph.h:41
std::map< std::string, float > GraphValues
Definition profiler.h:39
Definition clientmap.h:35
Definition profilergraph.h:27
Meta(float initial=0, video::SColor color=video::SColor(255, 255, 255, 255))
Definition profilergraph.h:31
float min
Definition profilergraph.h:28
float max
Definition profilergraph.h:29
video::SColor color
Definition profilergraph.h:30
Definition profilergraph.h:22
Profiler::GraphValues values
Definition profilergraph.h:24
Piece(Profiler::GraphValues v)
Definition profilergraph.h:23