Blackcomb  prealpha
Engine-ish
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
blackcomb::renderer::Shader Class Reference

Loads and stores shaders. More...

#include <Shader.h>

Public Member Functions

 Shader (const std::string &vertexFilename, const std::string &fragmentFilename)
 
void bind ()
 Bind the shader for usage.
 
void setUniformInt (const char *name, int val)
 Set an integer shader uniform. More...
 
void setUniformFloat (const char *name, float val)
 Set a float shader uniform. More...
 
void setUniformDouble (const char *name, double val)
 Set a double-precision float shader uniform. More...
 
void setUniformVecF (const char *name, std::vector< GLfloat > &val)
 
void setUniformVecF (const char *name, float val[], size_t size)
 
void setUniformMat4F (const char *name, GLfloat *value, GLboolean transpose=GL_FALSE)
 Set a 4x4 float matrix shader uniform. More...
 

Static Public Member Functions

static void unbind ()
 Unbind the shader.
 

Public Attributes

GLuint program
 

Detailed Description

Loads and stores shaders.

Currently only supports GLSL shaders.

Member Function Documentation

◆ setUniformDouble()

void blackcomb::renderer::Shader::setUniformDouble ( const char *  name,
double  val 
)

Set a double-precision float shader uniform.

Parameters
nameThe name of the uniform variable.
valThe value to pass to the shader.

◆ setUniformFloat()

void blackcomb::renderer::Shader::setUniformFloat ( const char *  name,
float  val 
)

Set a float shader uniform.

Parameters
nameThe name of the uniform variable.
valThe value to pass to the shader.

◆ setUniformInt()

void blackcomb::renderer::Shader::setUniformInt ( const char *  name,
int  val 
)

Set an integer shader uniform.

Parameters
nameThe name of the uniform variable.
valThe value to pass to the shader.

◆ setUniformMat4F()

void blackcomb::renderer::Shader::setUniformMat4F ( const char *  name,
GLfloat *  value,
GLboolean  transpose = GL_FALSE 
)

Set a 4x4 float matrix shader uniform.

Parameters
nameThe name of the uniform variable.
valAn array of floats to pass to the shader.
transposeWhether or not to transpose the matrix.-

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