The FontRenderer... renders fonts. It is just a very basic extension of the BasicRenderer, so it works the same. More...
#include <FontRenderer.hpp>
Inheritance diagram for BARE2D::FontRenderer:
Collaboration diagram for BARE2D::FontRenderer:Public Member Functions | |
| FontRenderer (std::string &fragShader, std::string &vertShader, unsigned int perspectiveWidth=2, unsigned int perspectiveHeight=2) | |
| ~FontRenderer () | |
| virtual void | draw (Font &font, glm::vec2 scaling, glm::vec4 destRect, const char *text, float depth, Colour tint, Justification just=Justification::LEFT, glm::vec4 uvRect=glm::vec4(0.0f, 0.0f, 1.0f, 1.0f)) |
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 | preRender () override |
| Does stuff inside of the render function, within the shader's use. 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 () |
| 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)) |
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 | initUniforms () |
| Initializes all uniforms, such as colour attachments, depth attachments, etc. More... | |
| virtual void | destroy () |
| Frees all necessary memory. More... | |
| virtual void | render () |
| Actually renders the contents to the screen! More... | |
| ShaderProgram * | getShader () |
Additional Inherited Members | |
Protected Member Functions inherited from BARE2D::BasicRenderer | |
| 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 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 |
The FontRenderer... renders fonts. It is just a very basic extension of the BasicRenderer, so it works the same.
Definition at line 22 of file FontRenderer.hpp.
| BARE2D::FontRenderer::FontRenderer | ( | std::string & | fragShader, |
| std::string & | vertShader, | ||
| unsigned int | perspectiveWidth = 2, |
||
| unsigned int | perspectiveHeight = 2 |
||
| ) |
Definition at line 5 of file FontRenderer.cpp.
| BARE2D::FontRenderer::~FontRenderer | ( | ) |
Definition at line 12 of file FontRenderer.cpp.
|
virtual |
| just | = Justification::LEFT |
| uvRect | = glm::vec4(0.0f, 0.0f, 1.0f, 1.0f) |
Definition at line 15 of file FontRenderer.cpp.
References BARE2D::BasicRenderer::draw(), FIRST_PRINTABLE_CHAR, BARE2D::Font::getCharacters(), BARE2D::Font::getGlyph(), BARE2D::Font::getHeight(), BARE2D::Font::getTextureID(), BARE2D::Font::measure(), BARE2D::MIDDLE, BARE2D::RIGHT, BARE2D::CharacterGlyph::size, and BARE2D::CharacterGlyph::uvRect.
Here is the call graph for this function: