![]() |
VR-Forces 4.8 Class Documentation
|
A convenience class to represent an OpenGL Shader Program. More...
Public Member Functions | |
| DtGlProgram (const std::string &name, const DtShaderVector &shaders) | |
| create a shader with a given name, from a list of input shaders More... | |
| virtual | ~DtGlProgram () |
| destroy the shader More... | |
| virtual void | bind () |
| make this shader the currently bound shader for use in OpenGL More... | |
| virtual void | unbind () |
| unbind the shader and use the default program of 0 More... | |
| virtual bool | isValid () const |
| A valid shader program is one that has valid shaders and they link together without error. More... | |
| virtual unsigned int | id () const |
| the OpenGL id of the internal shader program More... | |
Static Public Member Functions | |
| static bool | createProgram (const std::string &name, const VectorUnsignedInts &shaders, unsigned int &id) |
| static API functions More... | |
| static bool | createComputeProgram (unsigned int &id, const std::string &source, const std::string &prefixName) |
| Creates an OpenGL program from a list of OpenGL shader ids. More... | |
| static void | runComputeShader (unsigned int computeProgram, unsigned int workSizeX, unsigned int workSizeY, bool bind) |
| run a compute shader. More... | |
| static void | runComputeShader (unsigned int computeProgram, const DtGlTexture *renderTexture, bool bind) |
| run a compute shader. More... | |
Protected Attributes | |
| unsigned | myProgramID |
| bool | myIsValid |
| const DtShaderVector | myShaders |
Private Member Functions | |
| DtGlProgram () | |
| private default constructor. not allowed More... | |
| DtGlProgram (const DtGlProgram &) | |
| prevent copy-construction More... | |
| DtGlProgram & | operator= (const DtGlProgram &) |
| prevent assignment More... | |
A convenience class to represent an OpenGL Shader Program.
| makVrv::DtGlProgram::DtGlProgram | ( | const std::string & | name, |
| const DtShaderVector & | shaders | ||
| ) |
create a shader with a given name, from a list of input shaders
|
virtual |
destroy the shader
|
private |
private default constructor. not allowed
|
private |
prevent copy-construction
|
private |
prevent assignment
|
virtual |
make this shader the currently bound shader for use in OpenGL
|
virtual |
unbind the shader and use the default program of 0
|
virtual |
A valid shader program is one that has valid shaders and they link together without error.
the OpenGL id of the internal shader program
|
static |
static API functions
Creates an OpenGL program from a list of OpenGL shader ids. id is the new shader program id Returns True is the creation is successful
|
static |
Creates an OpenGL program from a list of OpenGL shader ids.
id is the new compute shader program id source is the shader source final program internal name is prefixName + "_program"
|
static |
run a compute shader.
workSizeX grid size in x dimension workSizeY grid size in y dimension bind whether to bind the program or not
|
static |
run a compute shader.
renderTexture is the texture into which the compute shader will compute results to. work group size is implicit in the texture size bind whether to bind the program or not
|
protected |
|
protected |
|
protected |