13 #ifndef _CS237_SHADER_HXX_
14 #define _CS237_SHADER_HXX_
17 #error "cs237-shader.hxx should not be included directly"
26 GLuint
Id()
const {
return this->_obj->_id; }
38 Obj (GLuint
id) : _id(id) { }
42 std::shared_ptr<Obj> _obj;
155 GLuint
Id () {
return this->_obj->_id; }
162 Obj (GLuint
id) : _id(id) { }
166 std::shared_ptr<Obj> _obj;
bool hasAttribute(const char *name)
does the shader have the given attribute variable?
Definition: cs237-shader.inl:31
bool hasUniform(const char *name)
does the shader have the given uniform variable?
Definition: cs237-shader.inl:36
int AttributeLocation(const char *name)
return the location of the given attribute in the given program.
ShaderProgram(VertexShader const &vsh, FragmentShader const &fsh)
bool LoadFromString(const char **prog)
int UniformLocation(const char *name)
return the location of the given uniform variable in the given program.
GLuint Id()
return the underlying OpenGL shader program ID
Definition: cs237-shader.hxx:155
VertexShader(const char *file)
load a vertex shader from a file.
Definition: cs237-shader.hxx:72
void Use()
use the given shader program for rendering.
Definition: cs237-shader.inl:26
Definition: cs237-shader.hxx:96
Definition: cs237-shader.hxx:48
GeometryShader(const char *file)
load a fragment shader from a file.
GLuint Id() const
Definition: cs237-shader.hxx:26
Definition: cs237-aabb.hxx:18
Definition: cs237-shader.hxx:120
Definition: cs237-shader.hxx:24
bool LoadFromFile(const char *file)
FragmentShader(const char *file)
load a fragment shader from a file.