CGFLib - A library for Computer Graphics @ FEUP
 All Classes Files Functions Variables Pages
Public Member Functions | List of all members
CGFshader Class Reference

Shader class for loading, storing, compiling, applying and updating GLSL shaders (vertex and fragment). More...

#include <CGFshader.h>

Public Member Functions

 CGFshader (void)
 Base constructor.
 
 CGFshader (const char *vsFile, const char *fsFile)
 Main constructor. Loads and validates the vertex and fragment shaders specified by vsFile and fsFile, using init().
 
virtual ~CGFshader (void)
 Base destructor.
 
virtual void init (const char *vsFile, const char *fsFile)
 Loads and validates the vertex and fragment shaders specified by vsFile and fsFile, using init().
 
virtual void update ()
 Updates the shader parameters (uniforms). In this base implementation, it updates the time uniform (if it exists) with CGFapplication::getTime().
 
virtual void update (float time)
 Updates the time uniform (if it exists) with the value time.
 
virtual void bind ()
 Binds (activates) the shader.
 
virtual void unbind ()
 Unbinds (deactivates) the shader, and reactivates the fixed-function pipeline.
 
unsigned int id ()
 Returns the shader id.
 

Detailed Description

Shader class for loading, storing, compiling, applying and updating GLSL shaders (vertex and fragment).