BARE2D
BARE2D::FontRenderer Class Reference

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< Camera2DgetCamera ()
 
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...
 
ShaderProgramgetShader ()
 

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< Camera2Dm_camera
 
- Protected Attributes inherited from BARE2D::Renderer
ShaderProgram m_shader
 
VAO m_vertexArrayObject
 
std::vector< RenderBatchm_batches
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FontRenderer()

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.

◆ ~FontRenderer()

BARE2D::FontRenderer::~FontRenderer ( )

Definition at line 12 of file FontRenderer.cpp.

Member Function Documentation

◆ draw()

void BARE2D::FontRenderer::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) 
)
virtual

The documentation for this class was generated from the following files: