20#define DEBUG_DRAW_START_ACTIVE true
22#define DEBUG_DRAW_START_ACTIVE false
46#pragma region static_functions
63 static auto Active() -> bool;
78#pragma region overridden_functions
82 return std::make_unique<DebugDraw>(*
this);
85 auto onUpdate(
float dt) ->
void override;
92 auto load(
const Stream& stream) ->
void override;
93 auto save(
Stream& stream)
const ->
void override;
98#pragma region DebugDraw_Functions
111#pragma region member_variables
114 std::vector<std::pair<gfx::Vertex, gfx::Vertex>>
lines;
122#pragma region helper_functions
127#pragma region static_variables
144#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:223
#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:24
Type
Definition System.h:20
@ DebugDraw
Definition System.h:38
System(const std::string &typeName, Type systemType)
Definition System.cpp:75
Definition DebugDraw.h:44
static auto ToggleActive() -> void
Definition DebugDraw.cpp:56
int lineWidth
Definition DebugDraw.h:117
auto operator=(const DebugDraw &other) -> DebugDraw &
Definition DebugDraw.cpp:85
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:99
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition DebugDraw.h:80
static auto getEnum() -> Type
function required by all systems
Definition DebugDraw.h:51
bool active
Definition DebugDraw.h:115
static auto drawLine(const gfx::Line &line) -> void
add a line to the debug renderer.
Definition DebugDraw.cpp:38
auto onRender() -> void override
called every frame after update has been called for every object.
Definition DebugDraw.cpp:133
std::shared_ptr< gfx::VertexBuffer > vertexBuffer
Definition DebugDraw.h:113
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition DebugDraw.cpp:196
static auto Active() -> bool
Definition DebugDraw.cpp:47
std::vector< std::pair< gfx::Vertex, gfx::Vertex > > lines
Definition DebugDraw.h:114
DebugDraw()
Definition DebugDraw.cpp:75
auto systemShowMenu() -> void override
Specific systems should override this function to show their specific menu for the system.
Definition DebugDraw.cpp:183
static auto setActive(bool setActive) -> void
Definition DebugDraw.cpp:66
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition DebugDraw.cpp:201
auto setupMesh() -> GLuint
Definition DebugDraw.cpp:104
~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:206
auto addLine(const gfx::Line &line) -> void
add a line to the debug renderer.
Definition DebugDraw.cpp:211
Definition FlipCardAction.h:25
the type of elements in a basic_json container
Definition GameObject.h:37