1 #ifndef NTA_GLSLPROGRAM_H_INCLUDED
2 #define NTA_GLSLPROGRAM_H_INCLUDED
4 #include "nta/MyEngine.h"
7 typedef unsigned int GLuint;
8 typedef unsigned int GLenum;
20 GLuint
compileShader(crstring shaderFileName, GLenum shaderType)
const;
55 #endif // NTA_GLSLPROGRAM_H_INCLUDED
void reload()
Reloads the program.
represents a program written in GLSL comprised of a vertex shader and a fragment shader
int m_numAttributes
the number of attributes used by the vertex shader
A (case-sensitive) Path in a file system.
void compileShaders(crstring shaderProgName)
compiles both the vertex and fragment shaders given their name
void linkShaders()
links the compiled shaders to this program
bool m_isLinked
keeps track of whether or not the shaders have been linked
utils::Path m_vert
The files containing the vertex and fragment shaders.
void destroy()
deletes this program
void addAttribute(crstring attributeName)
makes an attribute useful and assigns it the next available location
GLSLProgram()
constructor and destructor
bool isLinked() const
returns whether or not the shaders have been linked
void unuse() const
unbinds this program
GLint getUniformLocation(crstring uniformName) const
returns the location of a uniform in the shaders
GLuint m_programID
the id for the program
GLuint m_vertShaderID
the ids for the vertex and fragment shaders
void use() const
binds this program
GLuint compileShader(crstring shaderFileName, GLenum shaderType) const
compiles a shader from a file and returns its id