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

#include <cs237-shader.hxx>

Inherits cs237::__detail::Shader.

Public Member Functions

 VertexShader (const char *file)
 load a vertex shader from a file. More...
 
 VertexShader (const char **prog)
 define a shader from an array of strings More...
 
- Public Member Functions inherited from cs237::__detail::Shader
GLuint Id () const
 

Additional Inherited Members

- Protected Member Functions inherited from cs237::__detail::Shader
 Shader (GLenum kind)
 
bool LoadFromFile (const char *file)
 
bool LoadFromString (const char **prog)
 

Constructor & Destructor Documentation

cs237::VertexShader::VertexShader ( const char *  file)

load a vertex shader from a file.

Parameters
filethe name of the shader source file
Returns
a pointer to the vertex shader.

This function loads and compiles a vertex shader from a file. If there is an error, it will print information to stderr and return 0.

cs237::VertexShader::VertexShader ( const char **  prog)

define a shader from an array of strings

Parameters
progthe shader source code represented as an array of char pointers. The last element of the array should be nullptr.
Returns
a pointer to the vertex shader.

This function loads and compiles a vertex shader from a file. If there is an error, it will print information to stderr and return 0.


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