This is a BasicRenderer, but it includes the usage of bumpmaps. This can be useful for lighting. Has an additional uniform bumpmapSampler (sampler2D). More...
#include <BumpyRenderer.hpp>
Inheritance diagram for BARE2D::BumpyRenderer:
Collaboration diagram for BARE2D::BumpyRenderer:Public Member Functions | |
| BumpyRenderer (std::string &fragShader, std::string &vertShader, unsigned int perspectiveWidth=2, unsigned int perspectiveHeight=2) | |
| ~BumpyRenderer () | |
| virtual void | initUniforms () override |
| Initializes all uniforms, such as colour attachments, depth attachments, etc. More... | |
| virtual void | preRender () override |
| Does stuff inside of the render function, within the shader's use. More... | |
| virtual void | render () override |
| Actually renders the contents to the screen! More... | |
| virtual void | draw (glm::vec4 destRect, glm::vec4 uvRect, GLuint texture, float depth, Colour colour=Colour(255, 255, 255, 255), float angle=0.0f, glm::vec2 COR=glm::vec2(0.5f)) |
| virtual void | draw (glm::vec4 destRect, glm::vec4 uvRect, GLuint texture, GLuint bumpmap, float depth, Colour colour=Colour(255, 255, 255, 255), float angle=0.0f, glm::vec2 COR=glm::vec2(0.5f)) |
Public Member Functions inherited from BARE2D::BasicRenderer | |
| BasicRenderer (std::string &fragShader, std::string &vertShader, unsigned int perspectiveWidth=2, unsigned int perspectiveHeight=2) | |
| virtual | ~BasicRenderer () |
| virtual void | init () override |
| Initializes all necessary bits of the renderer. More... | |
| virtual void | setCamera (std::shared_ptr< Camera2D > camera) |
| Sets the camera to a given pointer. This means that the renderer takes ownership. More... | |
| std::shared_ptr< Camera2D > | getCamera () |
Public Member Functions inherited from BARE2D::Renderer | |
| Renderer () | |
| virtual | ~Renderer () |
| virtual void | begin () |
| Clears the necessary vectors, etc. to prepare for draw() calls, etc. More... | |
| virtual void | end () |
| Creates the renderbatches, does necessary stuff before render() call. 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 | link (std::initializer_list< std::string > attributes) |
Protected Attributes | |
| std::vector< GLuint > | m_batchBumpmaps |
Protected Attributes inherited from BARE2D::BasicRenderer | |
| std::string | m_fragShader |
| std::string | m_vertShader |
| std::vector< Glyph * > | m_glyphs |
| std::shared_ptr< Camera2D > | m_camera |
Protected Attributes inherited from BARE2D::Renderer | |
| ShaderProgram | m_shader |
| VAO | m_vertexArrayObject |
| std::vector< RenderBatch > | m_batches |
This is a BasicRenderer, but it includes the usage of bumpmaps. This can be useful for lighting. Has an additional uniform bumpmapSampler (sampler2D).
Definition at line 23 of file BumpyRenderer.hpp.
| BARE2D::BumpyRenderer::BumpyRenderer | ( | std::string & | fragShader, |
| std::string & | vertShader, | ||
| unsigned int | perspectiveWidth = 2, |
||
| unsigned int | perspectiveHeight = 2 |
||
| ) |
Definition at line 12 of file BumpyRenderer.cpp.
| BARE2D::BumpyRenderer::~BumpyRenderer | ( | ) |
Definition at line 16 of file BumpyRenderer.cpp.
|
overrideprotectedvirtual |
Constructs all of the render batches from data given by, say, draw() calls.
Reimplemented from BARE2D::BasicRenderer.
Definition at line 86 of file BumpyRenderer.cpp.
References BARE2D::VAO::bindVBO(), m_batchBumpmaps, BARE2D::Renderer::m_batches, BARE2D::BasicRenderer::m_glyphs, BARE2D::Renderer::m_vertexArrayObject, and BARE2D::VAO::unbindVBO().
Referenced by render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Reimplemented from BARE2D::BasicRenderer.
Definition at line 73 of file BumpyRenderer.cpp.
References BARE2D::throwFatalError(), and BARE2D::UNINITIALIZED_FUNCTION.
Here is the call graph for this function:
|
virtual |
Definition at line 77 of file BumpyRenderer.cpp.
References BARE2D::BasicRenderer::m_camera, and BARE2D::BasicRenderer::m_glyphs.
|
overridevirtual |
Initializes all uniforms, such as colour attachments, depth attachments, etc.
Reimplemented from BARE2D::Renderer.
Definition at line 19 of file BumpyRenderer.cpp.
References BARE2D::Renderer::m_shader, and BARE2D::ShaderProgram::setUniform().
Here is the call graph for this function:
|
overridevirtual |
Does stuff inside of the render function, within the shader's use.
Reimplemented from BARE2D::BasicRenderer.
Definition at line 27 of file BumpyRenderer.cpp.
References BARE2D::BasicRenderer::m_camera, BARE2D::Renderer::m_shader, and BARE2D::ShaderProgram::setUniformMatrix().
Referenced by render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Actually renders the contents to the screen!
Reimplemented from BARE2D::Renderer.
Definition at line 35 of file BumpyRenderer.cpp.
References BARE2D::VAO::bind(), BARE2D::GLContext::bindTexture(), createRenderBatches(), BARE2D::GLContextManager::getContext(), m_batchBumpmaps, BARE2D::Renderer::m_batches, BARE2D::Renderer::m_shader, BARE2D::Renderer::m_vertexArrayObject, preRender(), 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 42 of file BumpyRenderer.hpp.
Referenced by createRenderBatches(), and render().