VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions
makVrv::DtGlProgram Class Reference

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...
 
DtGlProgramoperator= (const DtGlProgram &)
 prevent assignment More...
 

Detailed Description

A convenience class to represent an OpenGL Shader Program.

Constructor & Destructor Documentation

makVrv::DtGlProgram::DtGlProgram ( const std::string &  name,
const DtShaderVector shaders 
)

create a shader with a given name, from a list of input shaders

virtual makVrv::DtGlProgram::~DtGlProgram ( )
virtual

destroy the shader

makVrv::DtGlProgram::DtGlProgram ( )
private

private default constructor. not allowed

makVrv::DtGlProgram::DtGlProgram ( const DtGlProgram )
private

prevent copy-construction

Member Function Documentation

DtGlProgram& makVrv::DtGlProgram::operator= ( const DtGlProgram )
private

prevent assignment

virtual void makVrv::DtGlProgram::bind ( )
virtual

make this shader the currently bound shader for use in OpenGL

virtual void makVrv::DtGlProgram::unbind ( )
virtual

unbind the shader and use the default program of 0

virtual bool makVrv::DtGlProgram::isValid ( ) const
virtual

A valid shader program is one that has valid shaders and they link together without error.

virtual unsigned int makVrv::DtGlProgram::id ( ) const
virtual

the OpenGL id of the internal shader program

static bool makVrv::DtGlProgram::createProgram ( const std::string &  name,
const VectorUnsignedInts shaders,
unsigned int id 
)
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 bool makVrv::DtGlProgram::createComputeProgram ( unsigned int id,
const std::string &  source,
const std::string &  prefixName 
)
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 void makVrv::DtGlProgram::runComputeShader ( unsigned int  computeProgram,
unsigned int  workSizeX,
unsigned int  workSizeY,
bool  bind 
)
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 void makVrv::DtGlProgram::runComputeShader ( unsigned int  computeProgram,
const DtGlTexture renderTexture,
bool  bind 
)
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

Member Data Documentation

unsigned makVrv::DtGlProgram::myProgramID
protected
bool makVrv::DtGlProgram::myIsValid
protected
const DtShaderVector makVrv::DtGlProgram::myShaders
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)