Esempio n. 1
0
void GlShaderProgram::getUniformFloatVariableValue(const std::string &variableName, float *value) {
  GLint loc = getUniformVariableLocation(variableName);
  glGetUniformfv(programObjectId, loc, value);
}
Esempio n. 2
0
void GlShaderProgram::getUniformIntVariableValue(const std::string &variableName, int *value) {
  GLint loc = getUniformVariableLocation(variableName);
  glGetUniformiv(programObjectId, loc, (GLint *)value);
}
Esempio n. 3
0
void GlShaderProgram::setUniformMat4FloatArray(const std::string &variableName, const unsigned int mat4fCount, const float *f, const bool transpose) {
  GLint loc = getUniformVariableLocation(variableName);
  GLboolean transposeGL = transpose ? GL_TRUE : GL_FALSE;
  glUniformMatrix4fv(loc, mat4fCount, transposeGL, f);
}
Esempio n. 4
0
void GlShaderProgram::setUniformVec4IntArray(const std::string &variableName, const unsigned int vec4iCount, const int *i) {
  GLint loc = getUniformVariableLocation(variableName);
  glUniform4iv(loc, vec4iCount, (const GLint*)i);
}
Esempio n. 5
0
void GlShaderProgram::setUniformVec4Bool(const std::string &variableName, const bool b1, const bool b2, const bool b3, const bool b4) {
  GLint loc = getUniformVariableLocation(variableName);
  glUniform4i(loc, b1, b2, b3, b4);
}
Esempio n. 6
0
void GlShaderProgram::setUniformVec4FloatArray(const std::string &variableName, const unsigned int vec4fCount, const float *f) {
  GLint loc = getUniformVariableLocation(variableName);
  glUniform4fv(loc, vec4fCount, f);
}
Esempio n. 7
0
void GlShaderProgram::setUniformVec4Int(const std::string &variableName, const int i1, const int i2, const int i3, const int i4) {
  GLint loc = getUniformVariableLocation(variableName);
  glUniform4i(loc, i1, i2, i3, i4);
}
Esempio n. 8
0
void GlShaderProgram::setUniformBool(const std::string &variableName, const bool b) {
  GLint loc = getUniformVariableLocation(variableName);
  glUniform1i(loc, b);
}
Esempio n. 9
0
void GlShaderProgram::setUniformInt(const std::string &variableName, const int i) {
  GLint loc = getUniformVariableLocation(variableName);
  glUniform1i(loc, i);
}
Esempio n. 10
0
void GlShaderProgram::setUniformVec2Int(const std::string &variableName, const int i1, const int i2) {
  GLint loc = getUniformVariableLocation(variableName);
  glUniform2i(loc, i1, i2);
}
Esempio n. 11
0
void GlShaderProgram::setUniformVec4Float(const std::string &variableName, const float f1, const float f2, const float f3, const float f4) {
  GLint loc = getUniformVariableLocation(variableName);
  glUniform4f(loc, f1, f2, f3, f4);
}
Esempio n. 12
0
void GlShaderProgram::setUniformFloat(const std::string &variableName, const float f) {
  GLint loc = getUniformVariableLocation(variableName);
  glUniform1f(loc, f);
}
Esempio n. 13
0
void
ShaderProgram::setUniform(const char *name, const Matrix4 *values,
                          int numValues)
{
	glUniformMatrix4fvARB(getUniformVariableLocation(name), numValues, GL_FALSE, (float *)values);
}
Esempio n. 14
0
void
ShaderProgram::setUniform(const char *name, const Vector3 *values,
                          int numValues)
{
	glUniform3fvARB(getUniformVariableLocation(name), numValues, (float *)values);
}
Esempio n. 15
0
void
ShaderProgram::setUniform(const char *name, int value)
{
	glUniform1iARB(getUniformVariableLocation(name), value);
}