CMSC23700 Common Code Library
Support code for CS23700 programming projects
cs237::ShaderProgram Class Reference

#include <cs237-shader.hxx>

Public Member Functions

 ShaderProgram (VertexShader const &vsh, FragmentShader const &fsh)
 
 ShaderProgram (VertexShader const &vsh, GeometryShader const &gsh, FragmentShader const &fsh)
 
void Use ()
 use the given shader program for rendering. More...
 
bool hasAttribute (const char *name)
 does the shader have the given attribute variable? More...
 
int AttributeLocation (const char *name)
 return the location of the given attribute in the given program. More...
 
bool hasUniform (const char *name)
 does the shader have the given uniform variable? More...
 
int UniformLocation (const char *name)
 return the location of the given uniform variable in the given program. More...
 
GLuint Id ()
 return the underlying OpenGL shader program ID More...
 

Constructor & Destructor Documentation

cs237::ShaderProgram::ShaderProgram ( VertexShader const &  vsh,
FragmentShader const &  fsh 
)
cs237::ShaderProgram::ShaderProgram ( VertexShader const &  vsh,
GeometryShader const &  gsh,
FragmentShader const &  fsh 
)

Member Function Documentation

int cs237::ShaderProgram::AttributeLocation ( const char *  name)

return the location of the given attribute in the given program.

Parameters
namethe name of the attribute
Returns
the location of the attribute
bool cs237::ShaderProgram::hasAttribute ( const char *  name)
inline

does the shader have the given attribute variable?

Parameters
namethe name of the attribute
Returns
true if the attribute is present, false otherwise
bool cs237::ShaderProgram::hasUniform ( const char *  name)
inline

does the shader have the given uniform variable?

Parameters
namethe name of the uniform
Returns
true if the uniform is present, false otherwise
GLuint cs237::ShaderProgram::Id ( )
inline

return the underlying OpenGL shader program ID

int cs237::ShaderProgram::UniformLocation ( const char *  name)

return the location of the given uniform variable in the given program.

Parameters
namethe name of the uniform variable
Returns
the location of the uniform variable
void cs237::ShaderProgram::Use ( )
inline

use the given shader program for rendering.


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