Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Member Functions | List of all members
om::graphics::devices::opengl::OpenGLShaderProgram Class Reference

A class that represents an OpenGL hardware-executed shading program. More...

#include <omGraphicsOpenGLShaderProgram.h>

Inheritance diagram for om::graphics::devices::opengl::OpenGLShaderProgram:
om::graphics::materials::DeviceShaderProgram om::graphics::devices::DeviceResource

Public Member Functions

 ~OpenGLShaderProgram ()
 Destroy this shader program and release all resources associated with it. More...
 
virtual Size getShaderCount () const
 Return the total number of shaders that are attached to this shader program. More...
 
virtual Shared< DeviceShadergetShader (Index shaderIndex) const
 Return a pointer to the shader object attached at the specified index to the shader program. More...
 
virtual Bool addShader (const Shared< DeviceShader > &newShader)
 Attach the specified shader to this shader program. More...
 
virtual Bool removeShader (Index shaderIndex)
 Detach the shader at the specified index from this shader program. More...
 
virtual Bool removeShader (const DeviceShader *shader)
 Detach the shader with the specified address from this shader program. More...
 
virtual void clearShaders ()
 Remove all shaders that are attached to this shader program. More...
 
virtual Bool link (StringOutputStream *linkLog=((void *) 0))
 Link the program's shaders into a useable shader program. More...
 
virtual Bool isLinked () const
 Return whether or not a link operation has been attempted on this shader program. More...
 
virtual Bool isValid () const
 Return whether or not the shader program was linked successfully and is ready for use. More...
 
virtual Size getConstantVariableCount () const
 Return the total number of constant variables that are part of this shader program. More...
 
virtual const ConstantVariablegetConstantVariable (Index variableIndex) const
 Return a pointer to the constant variable for this shader program at the given index. More...
 
virtual Bool getConstantVariable (const ShaderSourceString &variableName, const ConstantVariable *&variable) const
 Get the constant variable that is part of this shader program with the specified name. More...
 
virtual Bool getConstantVariableIndex (const ShaderSourceString &variableName, Index &variableIndex) const
 Get the constant variable index for this shader program with the specified name. More...
 
virtual Size getTextureVariableCount () const
 Return the total number of texture variables that are part of this shader program. More...
 
virtual const TextureVariablegetTextureVariable (Index variableIndex) const
 Return a pointer to the texture variable for this shader program at the given index. More...
 
virtual Bool getTextureVariable (const ShaderSourceString &variableName, const TextureVariable *&variable) const
 Get the texture variable that is part of this shader program with the specified name. More...
 
virtual Bool getTextureVariableIndex (const ShaderSourceString &variableName, Index &variableIndex) const
 Get the texture variable index for this shader program with the specified name. More...
 
virtual Size getVertexVariableCount () const
 Return the total number of vertex variables that are part of this shader program. More...
 
virtual const VertexVariablegetVertexVariable (Index variableIndex) const
 Return a pointer to the vertex variable for this shader program at the given index. More...
 
virtual Bool getVertexVariable (const ShaderSourceString &variableName, const VertexVariable *&variable) const
 Get the vertex variable that is part of this shader program with the specified name. More...
 
virtual Bool getVertexVariableIndex (const ShaderSourceString &variableName, Index &variableIndex) const
 Get the vertex variable index for this shader program with the specified name. More...
 
OpenGLID getID () const
 Return a unique integer identifier for this shader program within its context. More...
 
- Public Member Functions inherited from om::graphics::devices::DeviceResource
virtual ~DeviceResource ()
 Destroy a device object, releasing all internal state. More...
 
GraphicsContextgetContext () const
 Return a pointer to the graphics context associated with this DeviceResource. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::graphics::materials::DeviceShaderProgram
 DeviceShaderProgram (devices::GraphicsContext *newContext)
 Create a device shader program for the specified context. More...
 
- Protected Member Functions inherited from om::graphics::devices::DeviceResource
 DeviceResource (GraphicsContext *newContext)
 Create a new device object that is associated with the specified graphics context. More...
 

Detailed Description

A class that represents an OpenGL hardware-executed shading program.

Constructor & Destructor Documentation

om::graphics::devices::opengl::OpenGLShaderProgram::~OpenGLShaderProgram ( )

Destroy this shader program and release all resources associated with it.

Member Function Documentation

virtual Size om::graphics::devices::opengl::OpenGLShaderProgram::getShaderCount ( ) const
virtual

Return the total number of shaders that are attached to this shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Shared<DeviceShader> om::graphics::devices::opengl::OpenGLShaderProgram::getShader ( Index  shaderIndex) const
virtual

Return a pointer to the shader object attached at the specified index to the shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::addShader ( const Shared< DeviceShader > &  newShader)
virtual

Attach the specified shader to this shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::removeShader ( Index  shaderIndex)
virtual

Detach the shader at the specified index from this shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::removeShader ( const DeviceShader shader)
virtual

Detach the shader with the specified address from this shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual void om::graphics::devices::opengl::OpenGLShaderProgram::clearShaders ( )
virtual

Remove all shaders that are attached to this shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::link ( StringOutputStream linkLog = ((void *) 0))
virtual

Link the program's shaders into a useable shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::isLinked ( ) const
virtual

Return whether or not a link operation has been attempted on this shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::isValid ( ) const
virtual

Return whether or not the shader program was linked successfully and is ready for use.

Implements om::graphics::devices::DeviceResource.

virtual Size om::graphics::devices::opengl::OpenGLShaderProgram::getConstantVariableCount ( ) const
virtual

Return the total number of constant variables that are part of this shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual const ConstantVariable* om::graphics::devices::opengl::OpenGLShaderProgram::getConstantVariable ( Index  variableIndex) const
virtual

Return a pointer to the constant variable for this shader program at the given index.

Variable indices range from 0 up to the number of constant variables minus one. If an invalid variable index is specified, NULL is returned.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::getConstantVariable ( const ShaderSourceString variableName,
const ConstantVariable *&  variable 
) const
virtual

Get the constant variable that is part of this shader program with the specified name.

The constant variable, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::getConstantVariableIndex ( const ShaderSourceString variableName,
Index variableIndex 
) const
virtual

Get the constant variable index for this shader program with the specified name.

The constant variable's index, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Size om::graphics::devices::opengl::OpenGLShaderProgram::getTextureVariableCount ( ) const
virtual

Return the total number of texture variables that are part of this shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual const TextureVariable* om::graphics::devices::opengl::OpenGLShaderProgram::getTextureVariable ( Index  variableIndex) const
virtual

Return a pointer to the texture variable for this shader program at the given index.

Variable indices range from 0 up to the number of texture variables minus one. If an invalid variable index is specified, NULL is returned.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::getTextureVariable ( const ShaderSourceString variableName,
const TextureVariable *&  variable 
) const
virtual

Get the texture variable that is part of this shader program with the specified name.

The texture variable, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::getTextureVariableIndex ( const ShaderSourceString variableName,
Index variableIndex 
) const
virtual

Get the texture variable index for this shader program with the specified name.

The texture variable's index, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Size om::graphics::devices::opengl::OpenGLShaderProgram::getVertexVariableCount ( ) const
virtual

Return the total number of vertex variables that are part of this shader program.

Implements om::graphics::materials::DeviceShaderProgram.

virtual const VertexVariable* om::graphics::devices::opengl::OpenGLShaderProgram::getVertexVariable ( Index  variableIndex) const
virtual

Return a pointer to the vertex variable for this shader program at the given index.

Variable indices range from 0 up to the number of vertex variables minus one. If an invalid variable index is specified, NULL is returned.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::getVertexVariable ( const ShaderSourceString variableName,
const VertexVariable *&  variable 
) const
virtual

Get the vertex variable that is part of this shader program with the specified name.

The vertex variable, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.

Implements om::graphics::materials::DeviceShaderProgram.

virtual Bool om::graphics::devices::opengl::OpenGLShaderProgram::getVertexVariableIndex ( const ShaderSourceString variableName,
Index variableIndex 
) const
virtual

Get the vertex variable index for this shader program with the specified name.

The vertex variable's index, if found, is placed in the output reference parameter. The method returns whether or not this shader program has a variable with the given variable name.

Implements om::graphics::materials::DeviceShaderProgram.

OpenGLID om::graphics::devices::opengl::OpenGLShaderProgram::getID ( ) const
inline

Return a unique integer identifier for this shader program within its context.


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