Shader Tool
Small shader visualiser.
st::Canvas Class Reference

Customized GLCanvas class to act as a customizable framebuffer. More...

#include <Canvas.hpp>

Inheritance diagram for st::Canvas:

Public Member Functions

 Canvas (Widget *parent)
 Creates the canvas framebuffer. More...
 
 ~Canvas ()
 
virtual void drawGL () override
 Draws the framebuffer. More...
 
void setShader (shared_ptr< st::Shader > shader)
 Relaces the shader used to render the framebuffer. More...
 
nanogui::Vector2i loadTexture (string path)
 Loads a texture and binds it to the shader. More...
 

Private Attributes

nanogui::GLShader mShader
 
GLuint framebuffer_id
 
GLuint depthbuffer_id
 
GLuint out_texture_id
 
GLuint triangle_vbo0
 
GLuint triangle_vbo1
 

Static Private Attributes

static const GLsizei framebuffer_width = 2048
 The resolution in wich the scene is going to be rendered in the framebuffer. More...
 
static const GLsizei framebuffer_height = 2048
 

Detailed Description

Customized GLCanvas class to act as a customizable framebuffer.

Constructor & Destructor Documentation

◆ Canvas()

st::Canvas::Canvas ( Widget *  parent)

Creates the canvas framebuffer.

◆ ~Canvas()

st::Canvas::~Canvas ( )
inline

Member Function Documentation

◆ drawGL()

void st::Canvas::drawGL ( )
overridevirtual

Draws the framebuffer.

◆ loadTexture()

nanogui::Vector2i st::Canvas::loadTexture ( string  path)

Loads a texture and binds it to the shader.

Parameters
pathPath to the texture.

◆ setShader()

void st::Canvas::setShader ( shared_ptr< st::Shader shader)

Relaces the shader used to render the framebuffer.

Parameters
shaderReplacement shader.

Member Data Documentation

◆ depthbuffer_id

GLuint st::Canvas::depthbuffer_id
private

◆ framebuffer_height

const GLsizei st::Canvas::framebuffer_height = 2048
staticprivate

◆ framebuffer_id

GLuint st::Canvas::framebuffer_id
private

◆ framebuffer_width

const GLsizei st::Canvas::framebuffer_width = 2048
staticprivate

The resolution in wich the scene is going to be rendered in the framebuffer.

◆ mShader

nanogui::GLShader st::Canvas::mShader
private

◆ out_texture_id

GLuint st::Canvas::out_texture_id
private

◆ triangle_vbo0

GLuint st::Canvas::triangle_vbo0
private

◆ triangle_vbo1

GLuint st::Canvas::triangle_vbo1
private

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