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.

◆ ~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.

◆ 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.

◆ getName()

const SbString & SoGLShaderObject::getName ( ) const
inline

Definition at line 89 of file SoGLShaderObject.h.

◆ getShaderProgram()

SoGLShaderProgram * SoGLShaderObject::getShaderProgram ( ) const
inline

Definition at line 83 of file SoGLShaderObject.h.

◆ getSource()

const SbString & SoGLShaderObject::getSource ( ) const
inline

Definition at line 53 of file SoGLShaderObject.h.

◆ hadCompileError()

bool SoGLShaderObject::hadCompileError ( )
inline

Definition at line 94 of file SoGLShaderObject.h.

◆ isActive()

SbBool SoGLShaderObject::isActive ( ) const
inline

Definition at line 44 of file SoGLShaderObject.h.

◆ isCreated()

SbBool SoGLShaderObject::isCreated ( ) const
inline

Definition at line 63 of file SoGLShaderObject.h.

◆ 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.

◆ scheduleRebuild()

void SoGLShaderObject::scheduleRebuild ( )
inline

Definition at line 78 of file SoGLShaderObject.h.

◆ setAlwaysReadErrorLog()

void SoGLShaderObject::setAlwaysReadErrorLog ( bool flag)
inline

Definition at line 91 of file SoGLShaderObject.h.

◆ setEmulateLegacyOpenGL()

void SoGLShaderObject::setEmulateLegacyOpenGL ( bool flag)

◆ setName()

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

Definition at line 87 of file SoGLShaderObject.h.

◆ setSource()

void SoGLShaderObject::setSource ( const SbString & source)

◆ shaderType()

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

Definition at line 48 of file SoGLShaderObject.h.

◆ shouldCompile()

SbBool SoGLShaderObject::shouldCompile ( ) const
inline

Definition at line 74 of file SoGLShaderObject.h.

◆ version()

int SoGLShaderObject::version ( ) const
inline

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

Definition at line 61 of file SoGLShaderObject.h.

Member Data Documentation

◆ _alwaysReadErrorLog

bool SoGLShaderObject::_alwaysReadErrorLog
protected

Definition at line 118 of file SoGLShaderObject.h.

◆ _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.

◆ _hadError

bool SoGLShaderObject::_hadError
protected

Definition at line 119 of file SoGLShaderObject.h.

◆ _isActive

SbBool SoGLShaderObject::_isActive
protected

Definition at line 105 of file SoGLShaderObject.h.

◆ _name

SbString SoGLShaderObject::_name
protected

Definition at line 112 of file SoGLShaderObject.h.

◆ _shaderProgram

SoGLShaderProgram* SoGLShaderObject::_shaderProgram
protected

Definition at line 114 of file SoGLShaderObject.h.

◆ _shaderRes

ml::GLSLShader SoGLShaderObject::_shaderRes
protected

Definition at line 116 of file SoGLShaderObject.h.

◆ _shaderType

SoShader::ShaderType SoGLShaderObject::_shaderType
protected

Definition at line 104 of file SoGLShaderObject.h.

◆ _shouldCompile

SbBool SoGLShaderObject::_shouldCompile
protected

Definition at line 110 of file SoGLShaderObject.h.

◆ _source

SbString SoGLShaderObject::_source
protected

Definition at line 109 of file SoGLShaderObject.h.

◆ _version

int SoGLShaderObject::_version
protected

Definition at line 107 of file SoGLShaderObject.h.


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