 |
BARE2D
|
|
Go to the documentation of this file.
20 std::string& vertShader,
21 unsigned int windowWidth,
22 unsigned int windowHeight,
23 unsigned int numColourAttachments = 1);
26 virtual void init()
override;
29 void setCamera(std::shared_ptr<Camera2D>& cam);
37 virtual void render()
override;
39 virtual void begin()
override;
40 virtual void end()
override;
41 virtual void destroy()
override;
The renderer class holds some shader program, manages some VBO, some render batch(es),...
std::string m_vertexShaderPath
The FBORenderer represents and manages an entire FrameBufferObject. This allows one to draw entire sc...
virtual void createFBO()
Creates the OpenGL FBO instance and holds its handle in m_fboID;.
virtual void createTextures()
Creates all of the OpenGL textures, and takes their handles into m_colourTextureID,...
virtual void preRender() override
Does stuff inside of the render function, within the shader's use.
unsigned int m_numTextures
virtual void unbind()
Unbinds the FBO + textures.
void enableAttachment(unsigned int index)
void disableAttachment(unsigned int index)
virtual void init() override
Initializes all necessary bits of the renderer.
FBORenderer(std::string &fragShader, std::string &vertShader, unsigned int windowWidth, unsigned int windowHeight, unsigned int numColourAttachments=1)
void setCamera(std::shared_ptr< Camera2D > &cam)
virtual void createRenderBatches() override
Constructs all of the render batches from data given by, say, draw() calls.
virtual void initUniforms() override
Initializes all uniforms, such as colour attachments, depth attachments, etc.
std::string m_fragmentShaderPath
std::shared_ptr< Camera2D > m_camera
virtual void end() override
Creates the renderbatches, does necessary stuff before render() call.
virtual void bind()
Binds the FBO and appropriate texture attachments.
virtual void render() override
Actually renders the contents to the screen!
std::shared_ptr< Camera2D > getCamera()
void disableAttachments()
virtual void begin() override
Clears the necessary vectors, etc. to prepare for draw() calls, etc.
virtual void destroy() override
Frees all necessary memory.