Commit af0a33d4 authored by Jan Möbius's avatar Jan Möbius
Browse files

Uniform setters for Vec2f and Vec4f

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12546 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4330b55c
......@@ -288,6 +288,16 @@ namespace GLSL {
checkGLError2(name);
}
/** \brief Sets a uniform variable for the program.
*/
void Program::setUniform(const char *name, const ACG::Vec2f &value) {
checkGLError();
GLint location = glGetUniformLocation(this->m_programId, name);
checkGLError2(name);
glUniform2fv(location, 1, value.data());
checkGLError();
}
/** \brief Sets a uniform variable for the program.
*/
void Program::setUniform(const char *name, const ACG::Vec3f &value) {
......@@ -298,6 +308,16 @@ namespace GLSL {
checkGLError();
}
/** \brief Sets a uniform variable for the program.
*/
void Program::setUniform(const char *name, const ACG::Vec4f &value) {
checkGLError();
GLint location = glGetUniformLocation(this->m_programId, name);
checkGLError2(name);
glUniform4fv(location, 1, value.data());
checkGLError();
}
void Program::setUniform(const char *name, GLint *values, int count) {
checkGLError();
GLint location = glGetUniformLocation(this->m_programId, name);
......
......@@ -141,7 +141,9 @@ namespace GLSL {
void setUniform(const char *name, GLint value);
void setUniform(const char *name, GLfloat value);
void setUniform(const char *name, const ACG::Vec2f &value);
void setUniform(const char *name, const ACG::Vec3f &value);
void setUniform(const char *name, const ACG::Vec4f &value);
void setUniform(const char *name, GLint *value, int count);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment