Debug Draw 3D (and 2D) 1.3.1
Draw 3D debug graphics and 2D overlays with this add-on.
Loading...
Searching...
No Matches
stats_2d.h
1#pragma once
2
3#include "utils/compiler.h"
4
5GODOT_WARNING_DISABLE()
6#include <godot_cpp/classes/ref_counted.hpp>
7GODOT_WARNING_RESTORE()
8using namespace godot;
9
18class DebugDraw2DStats : public RefCounted {
19 GDCLASS(DebugDraw2DStats, RefCounted)
20
21protected:
23 static void _bind_methods();
24
25#define DEFINE_DEFAULT_PROP(name, type, def) \
26private: \
27 type name = def; \
28 \
29public: \
30 type get_##name() const { return name; } \
31 void set_##name(int64_t val) {}
32
33 DEFINE_DEFAULT_PROP(overlay_text_groups, int64_t, 0);
34 DEFINE_DEFAULT_PROP(overlay_text_lines, int64_t, 0);
35
36 DEFINE_DEFAULT_PROP(overlay_graphs_enabled, int64_t, 0);
37 DEFINE_DEFAULT_PROP(overlay_graphs_total, int64_t, 0);
38
39#undef DEFINE_DEFAULT_PROP
40
42
44 void setup(
45 const int64_t &t_overlay_text_groups,
46 const int64_t &t_overlay_text_lines,
47 const int64_t &t_overlay_graphs_enabled,
48 const int64_t &t_overlay_graphs_total) {
49
50 overlay_text_groups = t_overlay_text_groups;
51 overlay_text_lines = t_overlay_text_lines;
52
53 overlay_graphs_enabled = t_overlay_graphs_enabled;
54 overlay_graphs_total = t_overlay_graphs_total;
55 };
56};
You can get basic statistics about 2D rendering from this class.
Definition stats_2d.h:18