Open CASCADE Technology  6.9.0
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
OpenGl_ShaderProgram Class Reference

Wrapper for OpenGL program object. More...

#include <OpenGl_ShaderProgram.hxx>

Inheritance diagram for OpenGl_ShaderProgram:
Inheritance graph
[legend]

Public Member Functions

virtual ~OpenGl_ShaderProgram ()
 Releases resources of shader program. More...
 
Standard_Boolean Create (const Handle< OpenGl_Context > &theCtx)
 Creates new empty shader program of specified type. More...
 
virtual void Release (OpenGl_Context *theCtx)
 Destroys shader program. More...
 
Standard_Boolean AttachShader (const Handle< OpenGl_Context > &theCtx, const Handle< OpenGl_ShaderObject > &theShader)
 Attaches shader object to the program object. More...
 
Standard_Boolean DetachShader (const Handle< OpenGl_Context > &theCtx, const Handle< OpenGl_ShaderObject > &theShader)
 Detaches shader object to the program object. More...
 
Standard_Boolean Initialize (const Handle< OpenGl_Context > &theCtx, const Graphic3d_ShaderObjectList &theShaders)
 Initializes program object with the list of shader objects. More...
 
Standard_Boolean Link (const Handle< OpenGl_Context > &theCtx)
 Links the program object. More...
 
Standard_Boolean FetchInfoLog (const Handle< OpenGl_Context > &theCtx, TCollection_AsciiString &theLog)
 Fetches information log of the last link operation. More...
 
Standard_Boolean ApplyVariables (const Handle< OpenGl_Context > &theCtx)
 Fetches uniform variables from proxy shader program. More...
 
bool IsValid () const
 
GLuint ProgramId () const
 
GLint GetUniformLocation (const Handle< OpenGl_Context > &theCtx, const GLchar *theName) const
 Returns location of the specific uniform variable. More...
 
GLint GetAttributeLocation (const Handle< OpenGl_Context > &theCtx, const GLchar *theName) const
 Returns index of the generic vertex attribute by variable name. More...
 
GLint GetStateLocation (const GLuint theVariable) const
 Returns location of the OCCT state uniform variable. More...
 
Standard_Boolean GetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, OpenGl_Vec4i &theValue) const
 Returns the value of the integer uniform variable. More...
 
Standard_Boolean GetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, OpenGl_Vec4i &theValue) const
 
Standard_Boolean GetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, OpenGl_Vec4 &theValue) const
 Returns the value of the float uniform variable. More...
 
Standard_Boolean GetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, OpenGl_Vec4 &theValue) const
 Returns the value of the float uniform variable. More...
 
Standard_Boolean GetAttribute (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, OpenGl_Vec4i &theValue) const
 Returns the integer vertex attribute. More...
 
Standard_Boolean GetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, OpenGl_Vec4i &theValue) const
 Returns the integer vertex attribute. More...
 
Standard_Boolean GetAttribute (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, OpenGl_Vec4 &theValue) const
 Returns the float vertex attribute. More...
 
Standard_Boolean GetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, OpenGl_Vec4 &theValue) const
 Returns the float vertex attribute. More...
 
Standard_Boolean SetAttributeName (const Handle< OpenGl_Context > &theCtx, GLint theIndex, const GLchar *theName)
 Wrapper for glBindAttribLocation() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, GLfloat theValue)
 Wrapper for glVertexAttrib1f() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, GLfloat theValue)
 Wrapper for glVertexAttrib1f() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Vec2 &theValue)
 Wrapper for glVertexAttrib2fv() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, const OpenGl_Vec2 &theValue)
 Wrapper for glVertexAttrib2fv() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Vec3 &theValue)
 Wrapper for glVertexAttrib3fv() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, const OpenGl_Vec3 &theValue)
 Wrapper for glVertexAttrib3fv() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Vec4 &theValue)
 Wrapper for glVertexAttrib4fv() More...
 
Standard_Boolean SetAttribute (const Handle< OpenGl_Context > &theCtx, GLint theIndex, const OpenGl_Vec4 &theValue)
 Wrapper for glVertexAttrib4fv() More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, GLint theValue)
 Specifies the value of the integer uniform variable. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLint theValue)
 Specifies the value of the integer uniform variable. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Vec2i &theValue)
 Specifies the value of the integer uniform 2D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec2i &theValue)
 Specifies the value of the integer uniform 2D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Vec3i &theValue)
 Specifies the value of the integer uniform 3D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec3i &theValue)
 Specifies the value of the integer uniform 3D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Vec4i &theValue)
 Specifies the value of the integer uniform 4D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec4i &theValue)
 Specifies the value of the integer uniform 4D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, GLuint64 theValue)
 Specifies the value of the 64-bit unsigned integer uniform variable. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint64 theValue)
 Specifies the value of the 64-bit unsigned integer uniform variable. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const GLsizei theCount, const GLuint64 *theValue)
 Specifies the value of the 64-bit unsigned integer uniform array. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const GLsizei theCount, const GLuint64 *theValue)
 Specifies the value of the 64-bit unsigned integer uniform array. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, GLfloat theValue)
 Specifies the value of the float uniform variable. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLfloat theValue)
 Specifies the value of the float uniform variable. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Vec2 &theValue)
 Specifies the value of the float uniform 2D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec2 &theValue)
 Specifies the value of the float uniform 2D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Vec3 &theValue)
 Specifies the value of the float uniform 3D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec3 &theValue)
 Specifies the value of the float uniform 3D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Vec4 &theValue)
 Specifies the value of the float uniform 4D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Vec4 &theValue)
 Specifies the value of the float uniform 4D vector. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Mat4 &theValue, GLboolean theTranspose=GL_FALSE)
 Specifies the value of the float uniform 4x4 matrix. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Mat4 &theValue, GLboolean theTranspose=GL_FALSE)
 Specifies the value of the float uniform 4x4 matrix. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const OpenGl_Matrix &theValue, GLboolean theTranspose=GL_FALSE)
 Specifies the value of the float uniform 4x4 matrix. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const OpenGl_Matrix &theValue, GLboolean theTranspose=GL_FALSE)
 Specifies the value of the float uniform 4x4 matrix. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const Standard_ShortReal *theData)
 Specifies the value of the float uniform array. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec2 *theData)
 Specifies the value of the float2 uniform array. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec3 *theData)
 Specifies the value of the float3 uniform array. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec4 *theData)
 Specifies the value of the float4 uniform array. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const Standard_Integer *theData)
 Specifies the value of the integer uniform array. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec2i *theData)
 Specifies the value of the int2 uniform array. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec3i *theData)
 Specifies the value of the int3 uniform array. More...
 
Standard_Boolean SetUniform (const Handle< OpenGl_Context > &theCtx, GLint theLocation, GLuint theCount, const OpenGl_Vec4i *theData)
 Specifies the value of the int4 uniform array. More...
 
Standard_Boolean SetSampler (const Handle< OpenGl_Context > &theCtx, const GLchar *theName, const GLenum theTextureUnit)
 Specifies the value of the sampler uniform variable. More...
 
Standard_Boolean SetSampler (const Handle< OpenGl_Context > &theCtx, GLint theLocation, const GLenum theTextureUnit)
 Specifies the value of the sampler uniform variable. More...
 
- Public Member Functions inherited from OpenGl_Resource
 OpenGl_Resource ()
 Empty constructor. More...
 
virtual ~OpenGl_Resource ()
 Destructor. Inheritors should call Clean (NULL) within it. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Static Public Attributes

static const GLuint NO_PROGRAM = 0
 Non-valid shader name. More...
 
static const GLint INVALID_LOCATION = -1
 Invalid location of uniform/attribute variable. More...
 
static Standard_CString PredefinedKeywords [OpenGl_OCCT_NUMBER_OF_STATE_VARIABLES]
 List of pre-defined OCCT state uniform variables. More...
 

Protected Member Functions

 OpenGl_ShaderProgram (const Handle< Graphic3d_ShaderProgram > &theProxy=NULL)
 Creates uninitialized shader program. More...
 
bool Share ()
 Increments counter of users. Used by OpenGl_ShaderManager. More...
 
bool UnShare ()
 Decrements counter of users. Used by OpenGl_ShaderManager. More...
 

Protected Attributes

GLuint myProgramID
 Handle of OpenGL shader program. More...
 
OpenGl_ShaderList myShaderObjects
 List of attached shader objects. More...
 
Handle< Graphic3d_ShaderProgrammyProxy
 Proxy shader program (from application layer) More...
 
Standard_Integer myShareCount
 program users count, initialized with 1 (already shared by one user) More...
 
Standard_Size myCurrentState [MaxStateTypes]
 defines last modification for variables of each state type More...
 
GLint myStateLocations [OpenGl_OCCT_NUMBER_OF_STATE_VARIABLES]
 Stores locations of OCCT state uniform variables. More...
 

Static Protected Attributes

static
OpenGl_VariableSetterSelector 
mySetterSelector
 

Detailed Description

Wrapper for OpenGL program object.

Constructor & Destructor Documentation

OpenGl_ShaderProgram::OpenGl_ShaderProgram ( const Handle< Graphic3d_ShaderProgram > &  theProxy = NULL)
protected

Creates uninitialized shader program.

virtual OpenGl_ShaderProgram::~OpenGl_ShaderProgram ( )
virtual

Releases resources of shader program.

Member Function Documentation

Standard_Boolean OpenGl_ShaderProgram::ApplyVariables ( const Handle< OpenGl_Context > &  theCtx)

Fetches uniform variables from proxy shader program.

Standard_Boolean OpenGl_ShaderProgram::AttachShader ( const Handle< OpenGl_Context > &  theCtx,
const Handle< OpenGl_ShaderObject > &  theShader 
)

Attaches shader object to the program object.

Standard_Boolean OpenGl_ShaderProgram::Create ( const Handle< OpenGl_Context > &  theCtx)

Creates new empty shader program of specified type.

Standard_Boolean OpenGl_ShaderProgram::DetachShader ( const Handle< OpenGl_Context > &  theCtx,
const Handle< OpenGl_ShaderObject > &  theShader 
)

Detaches shader object to the program object.

Standard_Boolean OpenGl_ShaderProgram::FetchInfoLog ( const Handle< OpenGl_Context > &  theCtx,
TCollection_AsciiString theLog 
)

Fetches information log of the last link operation.

Standard_Boolean OpenGl_ShaderProgram::GetAttribute ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
OpenGl_Vec4i theValue 
) const

Returns the integer vertex attribute.

Standard_Boolean OpenGl_ShaderProgram::GetAttribute ( const Handle< OpenGl_Context > &  theCtx,
GLint  theIndex,
OpenGl_Vec4i theValue 
) const

Returns the integer vertex attribute.

Standard_Boolean OpenGl_ShaderProgram::GetAttribute ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
OpenGl_Vec4 theValue 
) const

Returns the float vertex attribute.

Standard_Boolean OpenGl_ShaderProgram::GetAttribute ( const Handle< OpenGl_Context > &  theCtx,
GLint  theIndex,
OpenGl_Vec4 theValue 
) const

Returns the float vertex attribute.

GLint OpenGl_ShaderProgram::GetAttributeLocation ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName 
) const

Returns index of the generic vertex attribute by variable name.

GLint OpenGl_ShaderProgram::GetStateLocation ( const GLuint  theVariable) const

Returns location of the OCCT state uniform variable.

Standard_Boolean OpenGl_ShaderProgram::GetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
OpenGl_Vec4i theValue 
) const

Returns the value of the integer uniform variable.

Standard_Boolean OpenGl_ShaderProgram::GetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
OpenGl_Vec4i theValue 
) const
Standard_Boolean OpenGl_ShaderProgram::GetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
OpenGl_Vec4 theValue 
) const

Returns the value of the float uniform variable.

Standard_Boolean OpenGl_ShaderProgram::GetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
OpenGl_Vec4 theValue 
) const

Returns the value of the float uniform variable.

GLint OpenGl_ShaderProgram::GetUniformLocation ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName 
) const

Returns location of the specific uniform variable.

Standard_Boolean OpenGl_ShaderProgram::Initialize ( const Handle< OpenGl_Context > &  theCtx,
const Graphic3d_ShaderObjectList theShaders 
)

Initializes program object with the list of shader objects.

bool OpenGl_ShaderProgram::IsValid ( ) const
inline
Returns
true if current object was initialized
Standard_Boolean OpenGl_ShaderProgram::Link ( const Handle< OpenGl_Context > &  theCtx)

Links the program object.

GLuint OpenGl_ShaderProgram::ProgramId ( ) const
inline
Returns
program ID
virtual void OpenGl_ShaderProgram::Release ( OpenGl_Context theCtx)
virtual

Destroys shader program.

Implements OpenGl_Resource.

Standard_Boolean OpenGl_ShaderProgram::SetAttribute ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
GLfloat  theValue 
)

Wrapper for glVertexAttrib1f()

Standard_Boolean OpenGl_ShaderProgram::SetAttribute ( const Handle< OpenGl_Context > &  theCtx,
GLint  theIndex,
GLfloat  theValue 
)

Wrapper for glVertexAttrib1f()

Standard_Boolean OpenGl_ShaderProgram::SetAttribute ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Vec2 theValue 
)

Wrapper for glVertexAttrib2fv()

Standard_Boolean OpenGl_ShaderProgram::SetAttribute ( const Handle< OpenGl_Context > &  theCtx,
GLint  theIndex,
const OpenGl_Vec2 theValue 
)

Wrapper for glVertexAttrib2fv()

Standard_Boolean OpenGl_ShaderProgram::SetAttribute ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Vec3 theValue 
)

Wrapper for glVertexAttrib3fv()

Standard_Boolean OpenGl_ShaderProgram::SetAttribute ( const Handle< OpenGl_Context > &  theCtx,
GLint  theIndex,
const OpenGl_Vec3 theValue 
)

Wrapper for glVertexAttrib3fv()

Standard_Boolean OpenGl_ShaderProgram::SetAttribute ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Vec4 theValue 
)

Wrapper for glVertexAttrib4fv()

Standard_Boolean OpenGl_ShaderProgram::SetAttribute ( const Handle< OpenGl_Context > &  theCtx,
GLint  theIndex,
const OpenGl_Vec4 theValue 
)

Wrapper for glVertexAttrib4fv()

Standard_Boolean OpenGl_ShaderProgram::SetAttributeName ( const Handle< OpenGl_Context > &  theCtx,
GLint  theIndex,
const GLchar *  theName 
)

Wrapper for glBindAttribLocation()

Standard_Boolean OpenGl_ShaderProgram::SetSampler ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const GLenum  theTextureUnit 
)

Specifies the value of the sampler uniform variable.

Standard_Boolean OpenGl_ShaderProgram::SetSampler ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const GLenum  theTextureUnit 
)

Specifies the value of the sampler uniform variable.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
GLint  theValue 
)

Specifies the value of the integer uniform variable.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLint  theValue 
)

Specifies the value of the integer uniform variable.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Vec2i theValue 
)

Specifies the value of the integer uniform 2D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const OpenGl_Vec2i theValue 
)

Specifies the value of the integer uniform 2D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Vec3i theValue 
)

Specifies the value of the integer uniform 3D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const OpenGl_Vec3i theValue 
)

Specifies the value of the integer uniform 3D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Vec4i theValue 
)

Specifies the value of the integer uniform 4D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const OpenGl_Vec4i theValue 
)

Specifies the value of the integer uniform 4D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
GLuint64  theValue 
)

Specifies the value of the 64-bit unsigned integer uniform variable.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLuint64  theValue 
)

Specifies the value of the 64-bit unsigned integer uniform variable.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const GLsizei  theCount,
const GLuint64 *  theValue 
)

Specifies the value of the 64-bit unsigned integer uniform array.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const GLsizei  theCount,
const GLuint64 *  theValue 
)

Specifies the value of the 64-bit unsigned integer uniform array.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
GLfloat  theValue 
)

Specifies the value of the float uniform variable.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLfloat  theValue 
)

Specifies the value of the float uniform variable.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Vec2 theValue 
)

Specifies the value of the float uniform 2D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const OpenGl_Vec2 theValue 
)

Specifies the value of the float uniform 2D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Vec3 theValue 
)

Specifies the value of the float uniform 3D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const OpenGl_Vec3 theValue 
)

Specifies the value of the float uniform 3D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Vec4 theValue 
)

Specifies the value of the float uniform 4D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const OpenGl_Vec4 theValue 
)

Specifies the value of the float uniform 4D vector.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Mat4 theValue,
GLboolean  theTranspose = GL_FALSE 
)

Specifies the value of the float uniform 4x4 matrix.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const OpenGl_Mat4 theValue,
GLboolean  theTranspose = GL_FALSE 
)

Specifies the value of the float uniform 4x4 matrix.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
const GLchar *  theName,
const OpenGl_Matrix theValue,
GLboolean  theTranspose = GL_FALSE 
)

Specifies the value of the float uniform 4x4 matrix.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
const OpenGl_Matrix theValue,
GLboolean  theTranspose = GL_FALSE 
)

Specifies the value of the float uniform 4x4 matrix.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLuint  theCount,
const Standard_ShortReal theData 
)

Specifies the value of the float uniform array.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLuint  theCount,
const OpenGl_Vec2 theData 
)

Specifies the value of the float2 uniform array.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLuint  theCount,
const OpenGl_Vec3 theData 
)

Specifies the value of the float3 uniform array.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLuint  theCount,
const OpenGl_Vec4 theData 
)

Specifies the value of the float4 uniform array.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLuint  theCount,
const Standard_Integer theData 
)

Specifies the value of the integer uniform array.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLuint  theCount,
const OpenGl_Vec2i theData 
)

Specifies the value of the int2 uniform array.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLuint  theCount,
const OpenGl_Vec3i theData 
)

Specifies the value of the int3 uniform array.

Standard_Boolean OpenGl_ShaderProgram::SetUniform ( const Handle< OpenGl_Context > &  theCtx,
GLint  theLocation,
GLuint  theCount,
const OpenGl_Vec4i theData 
)

Specifies the value of the int4 uniform array.

bool OpenGl_ShaderProgram::Share ( )
inlineprotected

Increments counter of users. Used by OpenGl_ShaderManager.

Returns
true when resource has been restored from delayed release queue
bool OpenGl_ShaderProgram::UnShare ( )
inlineprotected

Decrements counter of users. Used by OpenGl_ShaderManager.

Returns
true when there are no more users of this program has been left

Field Documentation

const GLint OpenGl_ShaderProgram::INVALID_LOCATION = -1
static

Invalid location of uniform/attribute variable.

Standard_Size OpenGl_ShaderProgram::myCurrentState[MaxStateTypes]
protected

defines last modification for variables of each state type

GLuint OpenGl_ShaderProgram::myProgramID
protected

Handle of OpenGL shader program.

Handle< Graphic3d_ShaderProgram > OpenGl_ShaderProgram::myProxy
protected

Proxy shader program (from application layer)

OpenGl_VariableSetterSelector OpenGl_ShaderProgram::mySetterSelector
staticprotected
OpenGl_ShaderList OpenGl_ShaderProgram::myShaderObjects
protected

List of attached shader objects.

Standard_Integer OpenGl_ShaderProgram::myShareCount
protected

program users count, initialized with 1 (already shared by one user)

GLint OpenGl_ShaderProgram::myStateLocations[OpenGl_OCCT_NUMBER_OF_STATE_VARIABLES]
protected

Stores locations of OCCT state uniform variables.

const GLuint OpenGl_ShaderProgram::NO_PROGRAM = 0
static

Non-valid shader name.

Standard_CString OpenGl_ShaderProgram::PredefinedKeywords[OpenGl_OCCT_NUMBER_OF_STATE_VARIABLES]
static

List of pre-defined OCCT state uniform variables.


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