MeVisLab Resolution Independence API
SoGLShaderObject Class Reference

Vertex or fragment shader object class. More...

#include <SoGLShaderObject.h>

Inheritance diagram for SoGLShaderObject:
SoGLShader

Public Member Functions

 SoGLShaderObject (SoShader::ShaderType shaderType)
 Constructor.
 ~SoGLShaderObject () override
 Destructor.
void reset () override
 Free all resources (OpenGL too) and reset instance to initial state.
void activate (SbBool act)
SbBool isActive () const
SoShader::ShaderType shaderType () const
void setSource (const SbString &source)
const SbString & getSource () const
void attach (SoGLShaderProgram *shaderProgram)
void detach ()
int version () const
 Get the used GLSL version (only available after compile()!).
SbBool isCreated () const
void compile ()
void scheduleCompile ()
SbBool shouldCompile () const
void scheduleRebuild ()
SoGLShaderProgramgetShaderProgram () const
void setName (const SbString &name)
const SbString & getName () const
void setAlwaysReadErrorLog (bool flag)
bool alwaysReadErrorLog ()
bool hadCompileError ()
const SbString & getErrorLog ()
void setEmulateLegacyOpenGL (bool flag)

Protected Member Functions

std::string adaptSourceString ()
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 Attributes

bool _emulateLegacyOpenGL
SoShader::ShaderType _shaderType
SbBool _isActive
int _version
SbString _source
SbBool _shouldCompile
SbString _name
SoGLShaderProgram_shaderProgram
ml::GLSLShader _shaderRes
bool _alwaysReadErrorLog
bool _hadError
SbString _errorLog

Additional Inherited Members

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.

Detailed Description

Vertex or fragment shader object class.

Definition at line 28 of file SoGLShaderObject.h.

Constructor & Destructor Documentation

◆ SoGLShaderObject()

SoGLShaderObject::SoGLShaderObject ( SoShader::ShaderType shaderType)

Constructor.

References shaderType().

◆ ~SoGLShaderObject()

SoGLShaderObject::~SoGLShaderObject ( )
override

Destructor.

Member Function Documentation

◆ activate()

void SoGLShaderObject::activate ( SbBool act)

◆ adaptSourceString()

std::string SoGLShaderObject::adaptSourceString ( )
protected

◆ alwaysReadErrorLog()

bool SoGLShaderObject::alwaysReadErrorLog ( )
inline

Definition at line 92 of file SoGLShaderObject.h.

References _alwaysReadErrorLog.

◆ attach()

void SoGLShaderObject::attach ( SoGLShaderProgram * shaderProgram)

◆ compile()

void SoGLShaderObject::compile ( )

◆ detach()

void SoGLShaderObject::detach ( )

◆ getErrorLog()

const SbString & SoGLShaderObject::getErrorLog ( )
inline

Definition at line 95 of file SoGLShaderObject.h.

References _errorLog.

◆ getName()

const SbString & SoGLShaderObject::getName ( ) const
inline

Definition at line 89 of file SoGLShaderObject.h.

References _name.

◆ getShaderProgram()

SoGLShaderProgram * SoGLShaderObject::getShaderProgram ( ) const
inline

Definition at line 83 of file SoGLShaderObject.h.

References _shaderProgram.

◆ getSource()

const SbString & SoGLShaderObject::getSource ( ) const
inline

Definition at line 53 of file SoGLShaderObject.h.

References _source.

◆ hadCompileError()

bool SoGLShaderObject::hadCompileError ( )
inline

Definition at line 94 of file SoGLShaderObject.h.

References _hadError.

◆ isActive()

SbBool SoGLShaderObject::isActive ( ) const
inline

Definition at line 44 of file SoGLShaderObject.h.

References _isActive.

◆ isCreated()

SbBool SoGLShaderObject::isCreated ( ) const
inline

Definition at line 63 of file SoGLShaderObject.h.

References _shaderRes.

◆ reset()

void SoGLShaderObject::reset ( )
overridevirtual

Free all resources (OpenGL too) and reset instance to initial state.

Reimplemented from SoGLShader.

◆ scheduleCompile()

void SoGLShaderObject::scheduleCompile ( )
inline

Definition at line 71 of file SoGLShaderObject.h.

References _shouldCompile.

◆ scheduleRebuild()

void SoGLShaderObject::scheduleRebuild ( )
inline

Definition at line 78 of file SoGLShaderObject.h.

References _shaderProgram, and _shouldCompile.

◆ setAlwaysReadErrorLog()

void SoGLShaderObject::setAlwaysReadErrorLog ( bool flag)
inline

Definition at line 91 of file SoGLShaderObject.h.

References _alwaysReadErrorLog.

◆ setEmulateLegacyOpenGL()

void SoGLShaderObject::setEmulateLegacyOpenGL ( bool flag)

◆ setName()

void SoGLShaderObject::setName ( const SbString & name)
inline

Definition at line 87 of file SoGLShaderObject.h.

References _name.

◆ setSource()

void SoGLShaderObject::setSource ( const SbString & source)

◆ shaderType()

SoShader::ShaderType SoGLShaderObject::shaderType ( ) const
inline

Definition at line 48 of file SoGLShaderObject.h.

References _shaderType.

Referenced by SoGLShaderObject().

◆ shouldCompile()

SbBool SoGLShaderObject::shouldCompile ( ) const
inline

Definition at line 74 of file SoGLShaderObject.h.

References _shouldCompile.

◆ version()

int SoGLShaderObject::version ( ) const
inline

Get the used GLSL version (only available after compile()!).

Definition at line 61 of file SoGLShaderObject.h.

References _version.

Member Data Documentation

◆ _alwaysReadErrorLog

bool SoGLShaderObject::_alwaysReadErrorLog
protected

Definition at line 118 of file SoGLShaderObject.h.

Referenced by alwaysReadErrorLog(), and setAlwaysReadErrorLog().

◆ _emulateLegacyOpenGL

bool SoGLShaderObject::_emulateLegacyOpenGL
protected

Definition at line 102 of file SoGLShaderObject.h.

◆ _errorLog

SbString SoGLShaderObject::_errorLog
protected

Definition at line 120 of file SoGLShaderObject.h.

Referenced by getErrorLog().

◆ _hadError

bool SoGLShaderObject::_hadError
protected

Definition at line 119 of file SoGLShaderObject.h.

Referenced by hadCompileError().

◆ _isActive

SbBool SoGLShaderObject::_isActive
protected

Definition at line 105 of file SoGLShaderObject.h.

Referenced by isActive().

◆ _name

SbString SoGLShaderObject::_name
protected

Definition at line 112 of file SoGLShaderObject.h.

Referenced by getName(), and setName().

◆ _shaderProgram

SoGLShaderProgram* SoGLShaderObject::_shaderProgram
protected

Definition at line 114 of file SoGLShaderObject.h.

Referenced by getShaderProgram(), and scheduleRebuild().

◆ _shaderRes

ml::GLSLShader SoGLShaderObject::_shaderRes
protected

Definition at line 116 of file SoGLShaderObject.h.

Referenced by isCreated().

◆ _shaderType

SoShader::ShaderType SoGLShaderObject::_shaderType
protected

Definition at line 104 of file SoGLShaderObject.h.

Referenced by shaderType().

◆ _shouldCompile

SbBool SoGLShaderObject::_shouldCompile
protected

Definition at line 110 of file SoGLShaderObject.h.

Referenced by scheduleCompile(), scheduleRebuild(), and shouldCompile().

◆ _source

SbString SoGLShaderObject::_source
protected

Definition at line 109 of file SoGLShaderObject.h.

Referenced by getSource().

◆ _version

int SoGLShaderObject::_version
protected

Definition at line 107 of file SoGLShaderObject.h.

Referenced by version().


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