MeVisLab Resolution Independence API
Loading...
Searching...
No Matches
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 ()
SoGLShaderProgram * getShaderProgram () 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 112 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 121 of file SoGLShaderObject.h.

References _errorLog.

◆ getName()

const SbString & SoGLShaderObject::getName ( ) const
inline

Definition at line 103 of file SoGLShaderObject.h.

References _name.

◆ getShaderProgram()

SoGLShaderProgram * SoGLShaderObject::getShaderProgram ( ) const
inline

Definition at line 93 of file SoGLShaderObject.h.

References _shaderProgram.

◆ getSource()

const SbString & SoGLShaderObject::getSource ( ) const
inline

Definition at line 54 of file SoGLShaderObject.h.

References _source.

◆ hadCompileError()

bool SoGLShaderObject::hadCompileError ( )
inline

Definition at line 117 of file SoGLShaderObject.h.

References _hadError.

◆ isActive()

SbBool SoGLShaderObject::isActive ( ) const
inline

Definition at line 43 of file SoGLShaderObject.h.

References _isActive.

◆ isCreated()

SbBool SoGLShaderObject::isCreated ( ) const
inline

Definition at line 68 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 78 of file SoGLShaderObject.h.

References _shouldCompile.

◆ scheduleRebuild()

void SoGLShaderObject::scheduleRebuild ( )
inline

Definition at line 87 of file SoGLShaderObject.h.

References _shaderProgram, and _shouldCompile.

◆ setAlwaysReadErrorLog()

void SoGLShaderObject::setAlwaysReadErrorLog ( bool flag)
inline

Definition at line 108 of file SoGLShaderObject.h.

References _alwaysReadErrorLog.

◆ setEmulateLegacyOpenGL()

void SoGLShaderObject::setEmulateLegacyOpenGL ( bool flag)

◆ setName()

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

Definition at line 98 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 82 of file SoGLShaderObject.h.

References _shouldCompile.

◆ version()

int SoGLShaderObject::version ( ) const
inline

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

Definition at line 63 of file SoGLShaderObject.h.

References _version.

Member Data Documentation

◆ _alwaysReadErrorLog

bool SoGLShaderObject::_alwaysReadErrorLog
protected

Definition at line 147 of file SoGLShaderObject.h.

Referenced by alwaysReadErrorLog(), and setAlwaysReadErrorLog().

◆ _emulateLegacyOpenGL

bool SoGLShaderObject::_emulateLegacyOpenGL
protected

Definition at line 131 of file SoGLShaderObject.h.

◆ _errorLog

SbString SoGLShaderObject::_errorLog
protected

Definition at line 149 of file SoGLShaderObject.h.

Referenced by getErrorLog().

◆ _hadError

bool SoGLShaderObject::_hadError
protected

Definition at line 148 of file SoGLShaderObject.h.

Referenced by hadCompileError().

◆ _isActive

SbBool SoGLShaderObject::_isActive
protected

Definition at line 134 of file SoGLShaderObject.h.

Referenced by isActive().

◆ _name

SbString SoGLShaderObject::_name
protected

Definition at line 141 of file SoGLShaderObject.h.

Referenced by getName(), and setName().

◆ _shaderProgram

SoGLShaderProgram* SoGLShaderObject::_shaderProgram
protected

Definition at line 143 of file SoGLShaderObject.h.

Referenced by getShaderProgram(), and scheduleRebuild().

◆ _shaderRes

ml::GLSLShader SoGLShaderObject::_shaderRes
protected

Definition at line 145 of file SoGLShaderObject.h.

Referenced by isCreated().

◆ _shaderType

SoShader::ShaderType SoGLShaderObject::_shaderType
protected

Definition at line 133 of file SoGLShaderObject.h.

Referenced by shaderType().

◆ _shouldCompile

SbBool SoGLShaderObject::_shouldCompile
protected

Definition at line 139 of file SoGLShaderObject.h.

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

◆ _source

SbString SoGLShaderObject::_source
protected

Definition at line 138 of file SoGLShaderObject.h.

Referenced by getSource().

◆ _version

int SoGLShaderObject::_version
protected

Definition at line 136 of file SoGLShaderObject.h.

Referenced by version().


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