Katana Plug-in APIs 0.1
Public Member Functions

Foundry::Katana::ViewerUtils::GLShaderProgram Class Reference

#include <FnGLShaderProgram.h>

List of all members.

Public Member Functions

void cleanup ()
void compileShader (const std::string &filename, ShaderType type)
void compileShader (const std::string &name, ShaderType type, const std::string &shaderSource)
GLuint getUniformLocation (const std::string &name)
 Gets the location of named uniform in the current shader program.
void link ()
 Links the currently attached shaders.
void use ()
 Activates the shader program.
GLuint getHandle () const
 Returns the raw shader handle;.
bool isLinked () const
 Returns true if the shader program has been linked.
void bindAttribLocation (GLuint location, const std::string &name)
 Binds the named attribute location to the specified index.
void bindFragDataLocation (GLuint location, const std::string &name)
 Binds the named fragment data location to the specified index.
void setUniform (const std::string &name, float val)
 Sets the value of the named uniform variable.
void setUniform (const std::string &name, float x, float y)
 Sets the value of the named uniform variable.
void setUniform (const std::string &name, float x, float y, float z)
 Sets the value of the named uniform variable.
void setUniform (const std::string &name, float x, float y, float z, float w)
 Sets the value of the named uniform variable.
void setUniform (const std::string &name, int val)
 Sets the value of the named uniform variable.
void setUniform (const std::string &name, bool val)
 Sets the value of the named uniform variable.
void setUniform (const std::string &name, FnAttribute::FloatAttribute val)
void setUniform (const std::string &name, FnAttribute::DoubleAttribute val)
void setUniform (const std::string &name, const Matrix44d &matrix)
 Sets the value of the named uniform variable.
void setUniformMatrix4d (const std::string &name, const double *matrix)
 Sets the value of the named uniform variable.

Detailed Description

This is a class that encapsulates the process of compiling and using GLSL shader programs.


Member Function Documentation

void Foundry::Katana::ViewerUtils::GLShaderProgram::cleanup ( )

Cleans up GL resources and other cached data.

void Foundry::Katana::ViewerUtils::GLShaderProgram::compileShader ( const std::string &  filename,
ShaderType  type 
)

Reads a GLSL shader from a file, compiles it and attaches it to the current program.

void Foundry::Katana::ViewerUtils::GLShaderProgram::compileShader ( const std::string &  name,
ShaderType  type,
const std::string &  shaderSource 
)

Compiles a GLSL shader from the passed shader source string, and attaches it to the current handle.

void Foundry::Katana::ViewerUtils::GLShaderProgram::setUniform ( const std::string &  name,
FnAttribute::DoubleAttribute  val 
)

Sets the value of the named uniform variable Can accept multiple sizes of DoubleAttribute values.

void Foundry::Katana::ViewerUtils::GLShaderProgram::setUniform ( const std::string &  name,
FnAttribute::FloatAttribute  val 
)

Sets the value of the named uniform variable Can accept multiple sizes of FloatAttribute values.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator