20#define DEBUG_DRAW_START_ACTIVE true
22#define DEBUG_DRAW_START_ACTIVE false
46#pragma region static_functions
74#pragma region overridden_functions
78 return std::make_unique<DebugDraw>(*
this);
81 auto onUpdate(
float dt) ->
void override;
88 auto load(
const Stream& stream) ->
void override;
89 auto save(
Stream& stream)
const ->
void override;
94#pragma region DebugDraw_Functions
107#pragma region member_variables
110 std::vector<std::pair<gfx::Vertex, gfx::Vertex>>
lines;
118#pragma region helper_functions
123#pragma region static_variables
140#undef DEBUG_DRAW_START_ACTIVE
sys::Json Stream
Definition AudioObject.h:20
auto operator<<(sys::DebugDraw *debug, const gfx::Line &line) -> sys::DebugDraw *
stream insertion operator for adding lines to the debug draw system Uses DebugDraw pointer instead of...
Definition DebugDraw.cpp:189
#define DEBUG_DRAW_START_ACTIVE
Definition DebugDraw.h:22
unsigned int GLuint
Definition IndexBuffer.h:17
A struct for stroing vertexes and handing them to opengl.
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23
Type
Definition System.h:20
@ DebugDraw
Definition System.h:37
System(const std::string &typeName, Type systemType)
Definition System.cpp:75
Definition DebugDraw.h:44
int lineWidth
Definition DebugDraw.h:113
auto operator=(const DebugDraw &other) -> DebugDraw &
Definition DebugDraw.cpp:51
auto operator=(DebugDraw &&other) noexcept -> DebugDraw &=default
DebugDraw(const DebugDraw &other)=default
auto onUpdate(float dt) -> void override
called once every frame.
Definition DebugDraw.cpp:65
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition DebugDraw.h:76
static auto getEnum() -> Type
function required by all systems
Definition DebugDraw.h:51
bool active
Definition DebugDraw.h:111
static auto drawLine(const gfx::Line &line) -> void
add a line to the debug renderer.
Definition DebugDraw.cpp:36
auto onRender() -> void override
called every frame after update has been called for every object.
Definition DebugDraw.cpp:99
std::shared_ptr< gfx::VertexBuffer > vertexBuffer
Definition DebugDraw.h:109
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition DebugDraw.cpp:162
std::vector< std::pair< gfx::Vertex, gfx::Vertex > > lines
Definition DebugDraw.h:110
DebugDraw()
Definition DebugDraw.cpp:41
auto systemShowMenu() -> void override
Specific systems should override this function to show their specific menu for the system.
Definition DebugDraw.cpp:149
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition DebugDraw.cpp:167
auto setupMesh() -> GLuint
Definition DebugDraw.cpp:70
~DebugDraw() override=default
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition DebugDraw.cpp:172
auto addLine(const gfx::Line &line) -> void
add a line to the debug renderer.
Definition DebugDraw.cpp:177
the type of elements in a basic_json container
Definition GameObject.h:32