17 #ifndef DEBUGRENDERER_H
18 #define DEBUGRENDERER_H
89 void queueCircle(
const Vector2& center,
float radius,
int segments,
unsigned int colorRgba);
98 unsigned int colorRgba);
125 unsigned int color = 0x00000000;
129 GLuint mode = GL_LINES;
132 DebugVertex* allocateVertices(
int count, GLuint mode);
133 void flushCurrentDraw();
138 1.0f, 0.0f, 0.0f, 0.0f,
139 0.0f, 1.0f, 0.0f, 0.0f,
140 0.0f, 0.0f, 1.0f, 0.0f,
141 0.0f, 0.0f, 0.0f, 1.0f };
142 bool mHasCurrentDraw =
false;
143 DebugDraw mCurrentDraw;
144 std::vector<DebugVertex> mVertexBuffer;
145 std::vector<DebugDraw> mDrawList;
146 std::vector<DebugVertex> mRenderVertexBuffer;
147 std::vector<DebugDraw> mRenderDrawList;
152 #endif // DEBUGRENDERER_H
Header declaring and including types common to renderer classes such as Vector2. Also includes GL hea...
A class with helper methods for rendering primitives like lines, for debug visualization.
Definition: DebugRenderer.h:36
float Matrix4[16]
4x4 float matrix, whose layout is compatible with GL.
Definition: RendererCommon.h:46
const Matrix4 & getProjectionMatrix() const
Gets the current projection matrix.
Definition: DebugRenderer.h:48
void flush()
Flushes the current shape being queued, preventing additional vertices from getting added to that dra...
void queueCircle(const Vector2 ¢er, float radius, int segments, unsigned int colorRgba)
Queues a circle centered about a point.
void queuePolygon(const Vector2 *points, int count, unsigned int colorRgba)
Queue a colored polygon line.
void queueLine(const Vector2 &pos1, const Vector2 &pos2, unsigned int colorRgba)
Queue a colored line segment.
void synchronizeForRendering()
Flips double buffered data, and clears the current queue.
b2Vec2 Vector2
2D float vector, whose layout is compatible with GL.
Definition: RendererCommon.h:50
void render()
Renders draw calls in the render queue.
void setProjectionMatrix(const Matrix4 &matrix)
Sets the current projection matrix.
DebugRenderer()
Constructs a DebugRenderer.
std::shared_ptr< MeshInstance > MeshInstancePtr
Shared pointer typedef for MeshInstance.
Definition: PointerDeclarations.h:113
std::shared_ptr< Mesh > MeshPtr
Shared pointer typedef for Mesh.
Definition: PointerDeclarations.h:103
void queueFilledCircle(const Vector2 ¢er, float radius, int segments, unsigned int colorRgba)
Queues a filled circle centered about a point.
void queueFilledPolygon(const Vector2 *points, int count, unsigned int colorRgba)
Queue a filled convex polygon shape.