Marbellous
Marbellous, a WebApp to generate paper marbling patterns.
Public Member Functions | List of all members
WGLRenderer Class Referenceabstract

Base class for rendering. More...

#include <WGLRenderer.hpp>

Inheritance diagram for WGLRenderer:
Inheritance graph
Collaboration diagram for WGLRenderer:
Collaboration graph

Public Member Functions

void setupShaderProgram (std::string vert, std::string frag, GLint &shader)
 Create a shader program. More...
 
void constructFBO (size_t x, bool stencil_depth, GLint interpolation, GLuint &fbo, GLuint &tex)
 Construct a FBO. More...
 
virtual void setActive () const =0
 All Renderer objects need to be set active to set the needed WGL state. More...
 
virtual void resize ()=0
 All Renderer objects should be resizeable. More...
 
void buildColorBuffer (Palette const &p, std::vector< GLfloat > &v)
 Build a color buffer from a palette which may be send to GPU. More...
 

Detailed Description

Base class for rendering.

Provides some basic function like shader compilation, FBO creation and color packing.

Member Function Documentation

◆ buildColorBuffer()

void WGLRenderer::buildColorBuffer ( Palette const &  p,
std::vector< GLfloat > &  v 
)
inline

Build a color buffer from a palette which may be send to GPU.

Parameters
pA palette.
vThe color buffer to fill.
Here is the caller graph for this function:

◆ constructFBO()

void WGLRenderer::constructFBO ( size_t  x,
bool  stencil_depth,
GLint  interpolation,
GLuint &  fbo,
GLuint &  tex 
)

Construct a FBO.

Parameters
xPixel resolution for the FBO.
stencil_depthWether to generate a stencil/depth buffer.
interpolationused on texture sampling
[out]fboFBO handle.
[out]texHandle for the FBO draw attachement which can be used as texture.
Here is the caller graph for this function:

◆ resize()

virtual void WGLRenderer::resize ( )
pure virtual

All Renderer objects should be resizeable.

Implemented in WGLSceneRenderer, WGLRakeRenderer, and WGLFilter.

◆ setActive()

virtual void WGLRenderer::setActive ( ) const
pure virtual

All Renderer objects need to be set active to set the needed WGL state.

Implemented in WGLSceneRenderer, WGLRakeRenderer, and WGLFilter.

◆ setupShaderProgram()

void WGLRenderer::setupShaderProgram ( std::string  vert,
std::string  frag,
GLint &  shader 
)

Create a shader program.

This includes error checking and linking of a vertex shader and a fragment shader.

Parameters
vertVertex shader code.
fragFragment shader code.
shaderShader program handle.
Here is the caller graph for this function:

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