Elevate Engine 1
Loading...
Searching...
No Matches
DebugRenderer.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef EE_EDITOR_BUILD
4#include <vector>
5#include "DebugTypes.h"
8#endif
9
10namespace Elevate
11{
13 {
14#ifdef EE_EDITOR_BUILD
15 glm::vec3 Position;
16 glm::vec4 Color;
17#endif
18 };
19
21 {
22#ifdef EE_EDITOR_BUILD
23 glm::vec3 Start;
24 glm::vec3 End;
25 glm::vec4 Color;
26#endif
27 };
28
29#ifdef EE_EDITOR_BUILD
30 class DebugRenderer
31 {
32 public:
33 static void Init();
34 static void Render();
35
36 static void AddDebugLine(DebugLineData line);
37 private:
38 static DebugRenderer& Get()
39 {
40 static DebugRenderer Instance;
41 return Instance;
42 }
43
44 private:
45 void InternalInit();
46 void InternalRender();
47
48 // Line debugger
49 void InitLineRender();
50 void ClearDebugLines();
51
52 private:
53 std::shared_ptr<Shader> m_lineShader;
54 std::shared_ptr<VertexArray> m_lineArray;
55 std::shared_ptr<VertexBuffer> m_lineBuffer;
56 std::vector<DebugVertex> m_debugLineArray;
57 };
58#else
59 // Empty declaration when building the game
61 {
62 public:
63 static void Init() { }
64 static void Render() { }
65 static void AddDebugLine(DebugLineData line) { }
66 };
67#endif
68}
static void AddDebugLine(DebugLineData line)