VR-Forces 4.6.1 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
 ~DtGlProgram ()
 destroy the shader
void bind ()
 make this shader the currently bound shader for use in OpenGL
void unbind ()
 unbind the shader and use the default program of 0
bool isValid () const
 A valid shader program is one that has valid shaders and they link together without error.
unsigned int id () const
 the OpenGL id of the internal shader program

Static Public Member Functions

static bool createProgram (const std::string &name, const VectorUnsignedInts &shaders, unsigned int &id)
 static API functions

Protected Attributes

unsigned myProgramID
bool myIsValid
const DtShaderVector myShaders

Private Member Functions

 DtGlProgram ()
 private default constructor
 DtGlProgram (const DtGlProgram &)
 prevent copy-construction
DtGlProgramoperator= (const DtGlProgram &)
 prevent assignment

Detailed Description

A convenience class to represent an OpenGL Shader Program.

Constructor & Destructor Documentation

makVrv::DtGlProgram::DtGlProgram ( )
private

private default constructor

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

prevent copy-construction

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

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

makVrv::DtGlProgram::~DtGlProgram ( )

destroy the shader

Member Function Documentation

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

prevent assignment

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

void makVrv::DtGlProgram::bind ( )

make this shader the currently bound shader for use in OpenGL

void makVrv::DtGlProgram::unbind ( )

unbind the shader and use the default program of 0

bool makVrv::DtGlProgram::isValid ( ) const

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

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

the OpenGL id of the internal shader program

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 Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)