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

#include <cs237-shader.hxx>

Inherits cs237::__detail::Shader.

Public Member Functions

 FragmentShader (const char *file)
 load a fragment shader from a file. More...
 
 FragmentShader (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::FragmentShader::FragmentShader ( const char *  file)

load a fragment shader from a file.

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

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

cs237::FragmentShader::FragmentShader ( 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 fragment shader.

This function loads and compiles a fragment 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: