MeVisLabToolboxReference
|
Class managing an OpenGL shader program. More...
#include <SoGLShaderProgram.h>
Classes | |
struct | UniformInfo |
Information structure for SoGLShaderObject containing location, type, and size. More... | |
Public Types | |
enum | LinkageResult { LR_FAILURE = 0, LR_SUCCESS = 1, LR_SKIPPED = 2 } |
Public Member Functions | |
SoGLShaderProgram () | |
Constructor. | |
virtual | ~SoGLShaderProgram () |
Destructor. | |
virtual void | reset () |
Free all resources (OpenGL too) and reset instance to initial state. | |
void | addShaderObject (SoGLShaderObject *shaderObject) |
void | removeShaderObject (SoGLShaderObject *shaderObject) |
void | removeAllShaderObjects () |
void | enable (int context) |
void | disable () |
void | scheduleLinking () |
void | setGeometryInputType (GLint type) |
void | setGeometryOutputType (GLint type) |
void | setGeometryVerticesOut (GLint number) |
virtual SbBool | isActiveUniform (const SbString &name) |
virtual void | clearAssignedTextureUnits () |
Clears the assigned texture units to 0. | |
virtual int | addTextureSampler (const SbString &name) |
Adds a new texture sampler with given name and returns the assigned texture unit. | |
virtual void | set1f (const SbString &name, const float value) |
virtual void | set2f (const SbString &name, const float *value) |
virtual void | set3f (const SbString &name, const float *value) |
virtual void | set4f (const SbString &name, const float *value) |
virtual void | set2f (const SbString &name, const float value0, const float value1) |
virtual void | set3f (const SbString &name, const float value0, const float value1, const float value2) |
virtual void | set4f (const SbString &name, const float value0, const float value1, const float value2, const float value3) |
virtual void | set1fv (const SbString &name, const int num, const float *value) |
virtual void | set2fv (const SbString &name, const int num, const float *value) |
virtual void | set3fv (const SbString &name, const int num, const float *value) |
virtual void | set4fv (const SbString &name, const int num, const float *value) |
virtual void | set1i (const SbString &name, const int32_t value) |
virtual void | set2i (const SbString &name, const int32_t *value) |
virtual void | set2i (const SbString &name, const SbVec2s &value) |
virtual void | set3i (const SbString &name, const int32_t *value) |
virtual void | set3i (const SbString &name, const SbVec3s &value) |
virtual void | set4i (const SbString &name, const int32_t *value) |
virtual void | setMatrix3f (const SbString &name, const float *value, SbBool transpose=FALSE) |
virtual void | setMatrix4f (const SbString &name, const float *value, SbBool transpose=FALSE) |
SbBool | areAllContextsStillValid (int context) |
Check if all contexts are still the same. | |
void | setName (const SbString &name) |
const SbString & | getName () const |
GLuint | getProgramHandle () const |
SbBool | isExecutable () const |
SbBool | shouldLink () const |
LinkageResult | link (int context) |
Protected Member Functions | |
GLint | getUniform (const SbString &name, GLenum type, int *num=NULL) |
Protected Attributes | |
GLint | _geometryInputType |
GLint | _geometryOutputType |
GLint | _geometryVerticesOut |
std::list< SoGLShaderObject * > | _shaderObjects |
SbBool | _shouldLink |
SbBool | _isExecutable |
SbString | _name |
int | _assignedTextureUnits |
std::map< std::string, UniformInfo > | _uniformInfo |
Class managing an OpenGL shader program.
Definition at line 27 of file SoGLShaderProgram.h.
Definition at line 112 of file SoGLShaderProgram.h.
SoGLShaderProgram::SoGLShaderProgram | ( | ) |
Constructor.
virtual SoGLShaderProgram::~SoGLShaderProgram | ( | ) | [virtual] |
Destructor.
void SoGLShaderProgram::addShaderObject | ( | SoGLShaderObject * | shaderObject | ) |
virtual int SoGLShaderProgram::addTextureSampler | ( | const SbString & | name | ) | [virtual] |
Adds a new texture sampler with given name and returns the assigned texture unit.
Reimplemented from SoUniformParameterBase.
SbBool SoGLShaderProgram::areAllContextsStillValid | ( | int | context | ) |
Check if all contexts are still the same.
virtual void SoGLShaderProgram::clearAssignedTextureUnits | ( | ) | [inline, virtual] |
Clears the assigned texture units to 0.
Definition at line 75 of file SoGLShaderProgram.h.
void SoGLShaderProgram::disable | ( | ) |
void SoGLShaderProgram::enable | ( | int | context | ) |
const SbString& SoGLShaderProgram::getName | ( | ) | const [inline] |
Definition at line 108 of file SoGLShaderProgram.h.
GLuint SoGLShaderProgram::getProgramHandle | ( | ) | const [inline] |
Definition at line 124 of file SoGLShaderProgram.h.
References PROGRAMHANDLE.
GLint SoGLShaderProgram::getUniform | ( | const SbString & | name, |
GLenum | type, | ||
int * | num = NULL |
||
) | [protected] |
virtual SbBool SoGLShaderProgram::isActiveUniform | ( | const SbString & | name | ) | [virtual] |
SbBool SoGLShaderProgram::isExecutable | ( | ) | const [inline] |
Definition at line 128 of file SoGLShaderProgram.h.
LinkageResult SoGLShaderProgram::link | ( | int | context | ) |
void SoGLShaderProgram::removeAllShaderObjects | ( | ) |
void SoGLShaderProgram::removeShaderObject | ( | SoGLShaderObject * | shaderObject | ) |
virtual void SoGLShaderProgram::reset | ( | ) | [virtual] |
Free all resources (OpenGL too) and reset instance to initial state.
Reimplemented from SoGLShader.
void SoGLShaderProgram::scheduleLinking | ( | ) |
virtual void SoGLShaderProgram::set1f | ( | const SbString & | name, |
const float | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set1fv | ( | const SbString & | name, |
const int | num, | ||
const float * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set1i | ( | const SbString & | name, |
const int32_t | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set2f | ( | const SbString & | name, |
const float | value0, | ||
const float | value1 | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set2f | ( | const SbString & | name, |
const float * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set2fv | ( | const SbString & | name, |
const int | num, | ||
const float * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set2i | ( | const SbString & | name, |
const SbVec2s & | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set2i | ( | const SbString & | name, |
const int32_t * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set3f | ( | const SbString & | name, |
const float * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set3f | ( | const SbString & | name, |
const float | value0, | ||
const float | value1, | ||
const float | value2 | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set3fv | ( | const SbString & | name, |
const int | num, | ||
const float * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set3i | ( | const SbString & | name, |
const SbVec3s & | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set3i | ( | const SbString & | name, |
const int32_t * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set4f | ( | const SbString & | name, |
const float * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set4f | ( | const SbString & | name, |
const float | value0, | ||
const float | value1, | ||
const float | value2, | ||
const float | value3 | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set4fv | ( | const SbString & | name, |
const int | num, | ||
const float * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::set4i | ( | const SbString & | name, |
const int32_t * | value | ||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
void SoGLShaderProgram::setGeometryInputType | ( | GLint | type | ) | [inline] |
Definition at line 62 of file SoGLShaderProgram.h.
void SoGLShaderProgram::setGeometryOutputType | ( | GLint | type | ) | [inline] |
Definition at line 65 of file SoGLShaderProgram.h.
void SoGLShaderProgram::setGeometryVerticesOut | ( | GLint | number | ) | [inline] |
Definition at line 68 of file SoGLShaderProgram.h.
virtual void SoGLShaderProgram::setMatrix3f | ( | const SbString & | name, |
const float * | value, | ||
SbBool | transpose = FALSE |
||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
virtual void SoGLShaderProgram::setMatrix4f | ( | const SbString & | name, |
const float * | value, | ||
SbBool | transpose = FALSE |
||
) | [virtual] |
Reimplemented from SoUniformParameterBase.
void SoGLShaderProgram::setName | ( | const SbString & | name | ) | [inline] |
Definition at line 106 of file SoGLShaderProgram.h.
SbBool SoGLShaderProgram::shouldLink | ( | ) | const [inline] |
Definition at line 132 of file SoGLShaderProgram.h.
int SoGLShaderProgram::_assignedTextureUnits [protected] |
Definition at line 146 of file SoGLShaderProgram.h.
GLint SoGLShaderProgram::_geometryInputType [protected] |
Definition at line 38 of file SoGLShaderProgram.h.
GLint SoGLShaderProgram::_geometryOutputType [protected] |
Definition at line 39 of file SoGLShaderProgram.h.
GLint SoGLShaderProgram::_geometryVerticesOut [protected] |
Definition at line 40 of file SoGLShaderProgram.h.
SbBool SoGLShaderProgram::_isExecutable [protected] |
Definition at line 142 of file SoGLShaderProgram.h.
SbString SoGLShaderProgram::_name [protected] |
Definition at line 144 of file SoGLShaderProgram.h.
std::list<SoGLShaderObject *> SoGLShaderProgram::_shaderObjects [protected] |
Definition at line 140 of file SoGLShaderProgram.h.
SbBool SoGLShaderProgram::_shouldLink [protected] |
Definition at line 141 of file SoGLShaderProgram.h.
std::map<std::string, UniformInfo> SoGLShaderProgram::_uniformInfo [protected] |
Definition at line 156 of file SoGLShaderProgram.h.