VR-Forces 5.0.3 Developer's Guide
 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 Member Functions | Protected Attributes | Private Member Functions
makVrv::DtGlProgram Class Reference

A convenience class to represent an OpenGL Shader Program.

Public Member Functions

 DtGlProgram (const std::string &name, const DtShaderVector &shaders, bool multiview=false)
 
 DtGlProgram (const std::string &name, unsigned int programId)
 
virtual ~DtGlProgram ()
 
virtual void bind ()
 
virtual void unbind ()
 
virtual bool isValid () const
 
virtual unsigned int id () const
 
virtual int uboSize (const std::string &name) const
 
virtual int uboBinding (const std::string &name) const
 
virtual int uniformOffset (const std::string &uniformName) const
 
virtual int uniformLocation (const std::string &uniformName) const
 
virtual const DtGlUboubo (const std::string &uboName) const
 
virtual void runComputeShader (unsigned int workSizeX, unsigned int workSizeY, bool bind)
 
virtual void runComputeShader (unsigned int workSizeX, unsigned int workSizeY, unsigned int workSizeZ, bool bind)
 
virtual void runComputeShader (const DtGlTexture *renderTexture, bool bind)
 

Static Public Member Functions

static void printGLSLInfoLog (unsigned int shader)
 

Protected Member Functions

virtual void introspect (void) const
 
virtual bool createProgram (const std::string &name, const VectorUnsignedInts &shaders)
 

Protected Attributes

unsigned myProgramID
 
bool myIsValid
 
bool myMutableIntrospected
 
std::unordered_map
< std::string, DtGlUbo * > 
myMutableUbos
 
const bool myOwns
 
const bool myIsMultiview
 

Private Member Functions

 DtGlProgram ()=delete
 
 DtGlProgram (const DtGlProgram &)=delete
 
DtGlProgramoperator= (const DtGlProgram &)=delete
 

Constructor & Destructor Documentation

makVrv::DtGlProgram::DtGlProgram ( const std::string &  name,
const DtShaderVector shaders,
bool  multiview = false 
)

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

makVrv::DtGlProgram::DtGlProgram ( const std::string &  name,
unsigned int  programId 
)

create a container DtGlProgram This constructed object does not own the gl program

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

destroy the shader

makVrv::DtGlProgram::DtGlProgram ( )
privatedelete

private default constructor. not allowed

makVrv::DtGlProgram::DtGlProgram ( const DtGlProgram )
privatedelete

prevent copy-construction

Member Function Documentation

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

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

virtual int makVrv::DtGlProgram::uboSize ( const std::string &  name) const
virtual

get the size of the ubo if it exists, 0 otherwise

virtual int makVrv::DtGlProgram::uboBinding ( const std::string &  name) const
virtual

get the binding of the ubo specified in the shader, -1 otherwise

virtual int makVrv::DtGlProgram::uniformOffset ( const std::string &  uniformName) const
virtual

get the offset a constant within an UBO if it exists, -1 otherwise

virtual int makVrv::DtGlProgram::uniformLocation ( const std::string &  uniformName) const
virtual

get the uniform location if it exists, -1 otherwise

virtual const DtGlUbo* makVrv::DtGlProgram::ubo ( const std::string &  uboName) const
virtual

get UBO details by name

virtual void makVrv::DtGlProgram::runComputeShader ( unsigned int  workSizeX,
unsigned int  workSizeY,
bool  bind 
)
virtual

run a compute shader. workSizeX grid size in x dimension workSizeY grid size in y dimension bind whether to bind the program or not

virtual void makVrv::DtGlProgram::runComputeShader ( unsigned int  workSizeX,
unsigned int  workSizeY,
unsigned int  workSizeZ,
bool  bind 
)
virtual

run a compute shader. workSizeX grid size in x dimension workSizeY grid size in y dimension workSizeZ grid size in z dimension bind whether to bind the program or not

virtual void makVrv::DtGlProgram::runComputeShader ( const DtGlTexture renderTexture,
bool  bind 
)
virtual

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

static void makVrv::DtGlProgram::printGLSLInfoLog ( unsigned int  shader)
static

print info of shader or program

virtual void makVrv::DtGlProgram::introspect ( void  ) const
protectedvirtual

do program introspection

virtual bool makVrv::DtGlProgram::createProgram ( const std::string &  name,
const VectorUnsignedInts shaders 
)
protectedvirtual

internal

Member Data Documentation

unsigned makVrv::DtGlProgram::myProgramID
protected
bool makVrv::DtGlProgram::myIsValid
protected
bool makVrv::DtGlProgram::myMutableIntrospected
mutableprotected
std::unordered_map<std::string, DtGlUbo*> makVrv::DtGlProgram::myMutableUbos
mutableprotected
const bool makVrv::DtGlProgram::myOwns
protected
const bool makVrv::DtGlProgram::myIsMultiview
protected

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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)