 |
BARE2D
|
|
Go to the documentation of this file.
20 BasicRenderer(std::string& fragShader, std::string& vertShader,
unsigned int perspectiveWidth = 2,
unsigned int perspectiveHeight = 2);
23 virtual void init()
override;
30 virtual void setCamera(std::shared_ptr<Camera2D> camera);
37 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));
The renderer class holds some shader program, manages some VBO, some render batch(es),...
std::vector< Glyph * > m_glyphs
std::shared_ptr< Camera2D > m_camera
virtual void setCamera(std::shared_ptr< Camera2D > camera)
Sets the camera to a given pointer. This means that the renderer takes ownership.
BasicRenderer(std::string &fragShader, std::string &vertShader, unsigned int perspectiveWidth=2, unsigned int perspectiveHeight=2)
virtual void createRenderBatches() override
Constructs all of the render batches from data given by, say, draw() calls.
virtual void preRender() override
Does stuff inside of the render function, within the shader's use.
std::shared_ptr< Camera2D > getCamera()
An RGBA 8-bit colour value.
virtual void init() override
Initializes all necessary bits of the renderer.
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))