MeVisLab Resolution Independence API
SoGLInventorShaderProgram Class Reference

Derived class which supports OpenGL legacy emulation and updating of uniforms when rendering Inventor scenes. More...

#include <SoShaderProgram.h>

Inheritance diagram for SoGLInventorShaderProgram:
SoGLShaderProgram SoGLShader SoUniformParameterBase

Public Member Functions

 SoGLInventorShaderProgram ()
 
void preLinkSetup () override
 Bind locations before linking the shader program.
 
void postLinkSetup () override
 Store information about uniforms locations.
 
void updateUniformsFromState (SoState *) override
 Update the shader uniforms according to the current Inventor state.
 
- Public Member Functions inherited from SoGLShaderProgram
 SoGLShaderProgram ()
 Constructor.
 
 ~SoGLShaderProgram () override
 Destructor.
 
void reset () override
 Free all resources (OpenGL too) and reset instance to initial state.
 
void addShaderObject (SoGLShaderObject *shaderObject)
 
void removeShaderObject (SoGLShaderObject *shaderObject)
 
void removeAllShaderObjects ()
 
void enable ()
 
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.
 
int getNumAssignedTextureUnits ()
 
void setNumAssignedTextureUnits (int num)
 
int addTextureSampler (const SbString &name) override
 Adds a new texture sampler with given name and returns the assigned texture unit.
 
void set1f (const SbString &name, const float value) override
 
void set2f (const SbString &name, const float *value) override
 
void set3f (const SbString &name, const float *value) override
 
void set4f (const SbString &name, const float *value) override
 
void set2f (const SbString &name, const float value0, const float value1) override
 
void set3f (const SbString &name, const float value0, const float value1, const float value2) override
 
void set4f (const SbString &name, const float value0, const float value1, const float value2, const float value3) override
 
void set1fv (const SbString &name, const int num, const float *value) override
 
void set2fv (const SbString &name, const int num, const float *value) override
 
void set3fv (const SbString &name, const int num, const float *value) override
 
void set4fv (const SbString &name, const int num, const float *value) override
 
void set1i (const SbString &name, const int32_t value) override
 
void set2i (const SbString &name, const int32_t *value) override
 
void set2i (const SbString &name, const SbVec2s &value) override
 
void set3i (const SbString &name, const int32_t *value) override
 
void set3i (const SbString &name, const SbVec3s &value) override
 
void set4i (const SbString &name, const int32_t *value) override
 
void setMatrix3fv (const SbString &, int, const float *, SbBool=FALSE) override
 
void setMatrix4fv (const SbString &, int, const float *, SbBool=FALSE) override
 
void setName (const SbString &name)
 
const SbString & getName () const
 
int shaderVersion (SoShader::ShaderType type) const
 Get the used GLSL version for the given shader type.
 
ml::GLSLProgramgetProgramResource ()
 
GLuint getProgramHandle () const
 
bool isValid ()
 returns if the shader is valid or needs re-creation
 
SbBool isExecutable () const
 
SbBool shouldLink () const
 
LinkageResult link ()
 
void updateUniformInfo (GLint programHandle)
 
void setAlwaysReadErrorLog (bool flag)
 
bool alwaysReadErrorLog ()
 
bool hadLinkError ()
 
const SbString & getErrorLog ()
 
- Public Member Functions inherited from SoUniformParameterBase
virtual void setMatrix3f (const SbString &name, const float *values, SbBool transpose=FALSE)
 
virtual void setMatrix4f (const SbString &name, const float *values, SbBool transpose=FALSE)
 
virtual void setSamplerInfo (const SbString &, SamplerType, uint32_t)
 

Additional Inherited Members

- Public Types inherited from SoGLShaderProgram
enum  LinkageResult { LR_FAILURE = 0 , LR_SUCCESS = 1 , LR_SKIPPED = 2 }
 
- Public Types inherited from SoUniformParameterBase
enum  SamplerType { SAMPLER_1D , SAMPLER_2D , SAMPLER_3D , SAMPLER_CUBEMAP }
 
- Static Public Member Functions inherited from SoGLShader
static SbBool isSupported ()
 Returns 'TRUE' if vertex and fragment shaders are supported by OpenGL.
 
static bool supportsGeometryShaders ()
 Returns if the hardware supports geometry shaders.
 
static void printCapabilities ()
 Prints capabilities of the OpenGL implementation.
 
- Protected Member Functions inherited from SoGLShaderProgram
GLint getUniform (const SbString &name, GLenum type, int *num=nullptr)
 
- Protected Member Functions inherited from SoGLShader
 SoGLShader ()
 Constructor.
 
virtual ~SoGLShader ()
 Destructor.
 
void errClear (const char *string=nullptr) const
 Clear OpenGL error state and print any previously not displayed error message.
 
void errCheck (const char *string=nullptr) const
 Check for OpenGL errors and print error message if one is found.
 
SbBool error (const char *string=nullptr) const
 Returns 'TRUE' if OpenGL error is found.
 
- Protected Member Functions inherited from SoUniformParameterBase
 SoUniformParameterBase ()
 Hidden constructor.
 
virtual ~SoUniformParameterBase ()
 Hidden destructor.
 
- Protected Attributes inherited from SoGLShaderProgram
ml::GLSLProgram _programRes
 
GLint _geometryInputType
 
GLint _geometryOutputType
 
GLint _geometryVerticesOut
 
std::list< SoGLShaderObject * > _shaderObjects
 
SbBool _shouldLink
 
SbBool _isExecutable
 
SbString _name
 
int _assignedTextureUnits
 
std::map< std::string, UniformInfo_uniformInfo
 
bool _alwaysReadErrorLog
 
bool _hadError
 
SbString _errorLog
 

Detailed Description

Derived class which supports OpenGL legacy emulation and updating of uniforms when rendering Inventor scenes.

Definition at line 36 of file SoShaderProgram.h.

Constructor & Destructor Documentation

◆ SoGLInventorShaderProgram()

SoGLInventorShaderProgram::SoGLInventorShaderProgram ( )

Member Function Documentation

◆ postLinkSetup()

void SoGLInventorShaderProgram::postLinkSetup ( )
overridevirtual

Store information about uniforms locations.

Reimplemented from SoGLShaderProgram.

◆ preLinkSetup()

void SoGLInventorShaderProgram::preLinkSetup ( )
overridevirtual

Bind locations before linking the shader program.

Reimplemented from SoGLShaderProgram.

◆ updateUniformsFromState()

void SoGLInventorShaderProgram::updateUniformsFromState ( SoState * )
overridevirtual

Update the shader uniforms according to the current Inventor state.

Reimplemented from SoGLShaderProgram.


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