#include <DebugRenderer.hpp>
Inheritance diagram for BARE2D::DebugRenderer:
Collaboration diagram for BARE2D::DebugRenderer:Public Member Functions | |
| DebugRenderer () | |
| virtual | ~DebugRenderer () |
| virtual void | init () override |
| Initializes with very rudimentary shaders (hardcoded), adds vertex attributes. More... | |
| virtual void | begin () override |
| Clears the necessary vectors, etc. to prepare for draw() calls, etc. More... | |
| virtual void | render () override |
| Actually renders the contents to the screen! More... | |
| virtual void | drawLine (glm::vec2 point0, glm::vec2 point1, float thickness, Colour colour) |
| Draws a line. More... | |
| virtual void | drawCircle (glm::vec2 centre, float lineThickness, float radius, Colour fillColour=Colour(255, 255, 255, 255)) |
| Draws a circle. More... | |
| virtual void | drawRectangle (glm::vec4 destRect, float lineThickness, Colour fillColour=Colour(255, 255, 255, 255)) |
| Draws a rectangle. More... | |
Public Member Functions inherited from BARE2D::Renderer | |
| Renderer () | |
| virtual | ~Renderer () |
| virtual void | end () |
| Creates the renderbatches, does necessary stuff before render() call. More... | |
| virtual void | initUniforms () |
| Initializes all uniforms, such as colour attachments, depth attachments, etc. More... | |
| virtual void | destroy () |
| Frees all necessary memory. More... | |
| ShaderProgram * | getShader () |
Protected Member Functions | |
| virtual void | createRenderBatches () override |
| Constructs all of the render batches from data given by, say, draw() calls. More... | |
Protected Member Functions inherited from BARE2D::Renderer | |
| virtual void | preRender () |
| Does stuff inside of the render function, within the shader's use. More... | |
| virtual void | link (std::initializer_list< std::string > attributes) |
Protected Attributes | |
| std::vector< Line > | m_lines |
| std::vector< Circle > | m_circles |
| std::vector< Rectangle > | m_rectangles |
Protected Attributes inherited from BARE2D::Renderer | |
| ShaderProgram | m_shader |
| VAO | m_vertexArrayObject |
| std::vector< RenderBatch > | m_batches |
Definition at line 42 of file DebugRenderer.hpp.
| BARE2D::DebugRenderer::DebugRenderer | ( | ) |
Definition at line 68 of file DebugRenderer.cpp.
|
virtual |
Definition at line 71 of file DebugRenderer.cpp.
|
overridevirtual |
Clears the necessary vectors, etc. to prepare for draw() calls, etc.
Reimplemented from BARE2D::Renderer.
Definition at line 90 of file DebugRenderer.cpp.
References BARE2D::Renderer::begin(), m_circles, m_lines, and m_rectangles.
Here is the call graph for this function:
|
overrideprotectedvirtual |
Constructs all of the render batches from data given by, say, draw() calls.
Implements BARE2D::Renderer.
Definition at line 113 of file DebugRenderer.cpp.
References BARE2D::VAO::bindVBO(), CIRCLE_LINES, m_circles, m_lines, m_rectangles, and BARE2D::Renderer::m_vertexArrayObject.
Here is the call graph for this function:
|
virtual |
Draws a circle.
| centre | The centre point of the circle |
| lineThickness | The thickness of the lines creating the circle |
| radius | The radius of the circle |
| lineColour | The colour of the lines |
| fillColour | The fill of the circle |
Definition at line 103 of file DebugRenderer.cpp.
References m_circles.
|
virtual |
Draws a line.
| point0 | The origin |
| point1 | Where the line goes to |
| thickness | The thickness of the line |
| colour | The colour of the line |
Definition at line 98 of file DebugRenderer.cpp.
References m_lines.
|
virtual |
Draws a rectangle.
| destRect | The destination rectangle of the rectangle (position, then size) |
| lineColour | The colour of the lines that make up the rectangle |
| fillColour | The colour of the fill. |
Definition at line 108 of file DebugRenderer.cpp.
References m_rectangles.
|
overridevirtual |
Initializes with very rudimentary shaders (hardcoded), adds vertex attributes.
Reimplemented from BARE2D::Renderer.
Definition at line 74 of file DebugRenderer.cpp.
References BARE2D::VAO::addVertexAttribute(), BARE2D::ShaderProgram::compileShadersFromSource(), fragShaderSource, BARE2D::Renderer::init(), BARE2D::Renderer::link(), BARE2D::Renderer::m_shader, BARE2D::Renderer::m_vertexArrayObject, and vertShaderSource.
Here is the call graph for this function:
|
overridevirtual |
Actually renders the contents to the screen!
Reimplemented from BARE2D::Renderer.
Definition at line 196 of file DebugRenderer.cpp.
References BARE2D::VAO::bind(), CIRCLE_LINES, BARE2D::GLContextManager::getContext(), m_circles, m_lines, m_rectangles, BARE2D::Renderer::m_shader, BARE2D::Renderer::m_vertexArrayObject, BARE2D::GLContext::setActiveTexture(), BARE2D::VAO::unbind(), BARE2D::ShaderProgram::unuse(), and BARE2D::ShaderProgram::use().
Here is the call graph for this function:
|
protected |
Definition at line 87 of file DebugRenderer.hpp.
Referenced by begin(), createRenderBatches(), drawCircle(), and render().
|
protected |
Definition at line 86 of file DebugRenderer.hpp.
Referenced by begin(), createRenderBatches(), drawLine(), and render().
|
protected |
Definition at line 88 of file DebugRenderer.hpp.
Referenced by begin(), createRenderBatches(), drawRectangle(), and render().