33 #include <unordered_map> 66 void createShaderProgram(
const std::string &_name ) noexcept;
89 void compileShader(
const std::string &_name ) noexcept;
94 void linkProgramObject(
const std::string &_name ) noexcept;
144 const bool _exitOnError=
false ) noexcept;
148 bool loadFromJson(
const std::string &_fname) noexcept;
168 void setShaderParamFromMat4(
const std::string &_paramName,
Mat4 _p1 ) noexcept;
175 void setRegisteredUniformFromMat4(
const std::string &_registeredUniformName,
Mat4 _p1 ) noexcept;
182 void setShaderParamFromMat3(
const std::string &_paramName,
Mat3 _p1 ) noexcept;
188 void setRegisteredUniformFromMat3(
const std::string &_paramName,
Mat3 _p1 ) noexcept;
196 void setShaderParamFromVec4(
const std::string &_paramName,
Vec4 _p1) noexcept;
203 void setRegisteredUniformVec4(
const std::string &_paramName,
Vec4 _p1) noexcept;
210 void setShaderParamFromColour(
const std::string &_paramName,
Colour _p1 ) noexcept;
217 void setRegisteredUniformFromColour(
const std::string &_paramName,
Colour _p1 ) noexcept;
223 void setRegisteredUniformVec3(
const std::string &_paramName,
Vec3 _p1 ) noexcept;
229 void setRegisteredUniformVec2(
const std::string &_paramName,
Vec2 _p1 ) noexcept;
237 void setShaderParam1i(
const std::string &_paramName,
int _p1 ) noexcept;
243 void setRegisteredUniform1i(
const std::string &_paramName,
int _p1 ) noexcept;
250 void setShaderParam1f(
const std::string &_paramName,
float _p1 ) noexcept;
257 void setRegisteredUniform1f(
const std::string &_paramName,
float _p1 ) noexcept;
265 void setShaderParam2f(
const std::string &_paramName,
float _p1,
float _p2 ) noexcept;
272 void setRegisteredUniform2f(
const std::string &_paramName,
float _p1,
float _p2 ) noexcept;
281 void setShaderParam3f(
const std::string &_paramName,
float _p1,
float _p2,
float _p3 ) noexcept;
289 void setRegisteredUniform3f(
const std::string &_paramName,
float _p1,
float _p2,
float _p3 ) noexcept;
299 void setShaderParam4f(
const std::string &_paramName,
float _p1,
float _p2,
float _p3,
float _p4 ) noexcept;
307 void setRegisteredUniform4f(
const std::string &_paramName,
float _p1,
float _p2,
float _p3,
float _p4) noexcept;
311 void printProperties()
const noexcept;
315 void reset() noexcept;
341 void useNullProgram() noexcept;
348 GLuint getUniformBlockIndex(
const std::string &_uniformBlockName )
const noexcept;
360 void autoRegisterUniforms(
const std::string &_shaderName ) noexcept;
364 void printRegisteredUniforms(
const std::string &_shader)
const noexcept;
379 void setRegisteredUniform(
const std::string &_paramName,
Real _v0) noexcept;
451 void setRegisteredUniform(
const std::string &_paramName,
GLint _v0) noexcept;
538 void setRegisteredUniform(
const std::string &_paramName,
Vec2 _v0) noexcept;
553 void setRegisteredUniform(
const std::string &_paramName,
Vec3 _v0) noexcept;
568 void setRegisteredUniform(
const std::string &_paramName,
Vec4 _v0) noexcept;
583 void setRegisteredUniform(
const std::string &_paramName,
Mat3 _v0) noexcept;
598 void setRegisteredUniform(
const std::string &_paramName,
Mat4 _v0) noexcept;
621 void loadTextShaders() noexcept;
626 void loadColourShaders() noexcept;
631 void loadDiffuseShaders() noexcept;
636 void loadToonShaders() noexcept;
void debugOff() noexcept
Toggle debug mode off.
Mat3 basic 3x3 matrix for certain glsl ops.
simple Vec2 encapsulates a 3 float object like glsl Vec2 but not maths use the Vec2 class for maths a...
simple class to hold colour information and set the basic opengl colour state. also has overloaded me...
simple Vector class for OpenGL graphics, contains overloaded operators for most math functions...
a simple colour class for RGBA colour
main definition of types and namespace
GLuint GLuint GLsizei GLenum type
size_t getNumShaders() const noexcept
get the number of shaders stored
Singleton Class to init and Use GLSL Shaders the class stores the shaders as a map of shader objects ...
simple Vec3 encapsulates a 3 float object like glsl vec3 but not maths use the Vec3 class for maths a...
implementation files for RibExport class
unsigned int m_numShaders
the nunmber of shaders loaded
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
encapsulates a 4d Homogenous Point / Vector object
std::string m_currentShader
the name of the currently active shader
void toggleDebug() noexcept
toggle debug mode
std::unordered_map< std::string, ShaderProgram * > m_shaderPrograms
a map of shader Programs using name as key to shader pointer
void debugOn() noexcept
Toggle debug mode on.
and encapsulation of an OpenGL Shader object with associations for source code, etc. Used in conjunction with the ShaderProgram class
a simple singleton template inherited by other classes
ShaderProgram * m_nullProgram
null ShaderProgram so we can return when shader not know;
bool m_debugState
flag to indicate the debug state
Matrix Class to do simple matrix operations included operator overloaded functions for maths and matr...
std::unordered_map< std::string, Shader * > m_shaders
map of shaders using name as key
GLsizei const GLchar *const * string
Singleton template added to NGL framework 20/04/10 by jmacey.