summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-01-28 09:51:23 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-08 16:37:21 +0000
commitd12f65a66a67972d0373dc50bf40baf37d08066a (patch)
treeed5fb53eb8215dd0a3a67ce450a819d2fd2e2961 /src/gui/opengl
parentc2f26d6d0b70e591c74bf6664e30288a2d63dc9a (diff)
Add more notes regarding the uniform setters
Having overloads for GLuint that call glUniformNi was a mistake to begin with, and it has only been made worse when later OpenGL versions introduced unsigned int support and glUniformNui. Note this in the docs. Task-number: QTBUG-37012 Change-Id: Icc867221d0fbced8c4ff769deee66effa022f1b5 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/qopenglshaderprogram.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
index 2d99833fdf..61efbe03ee 100644
--- a/src/gui/opengl/qopenglshaderprogram.cpp
+++ b/src/gui/opengl/qopenglshaderprogram.cpp
@@ -1970,6 +1970,9 @@ void QOpenGLShaderProgram::setUniformValue(const char *name, GLint value)
Sets the uniform variable at \a location in the current context to \a value.
This function should be used when setting sampler values.
+ \note This function is not aware of unsigned int support in modern OpenGL
+ versions and therefore treats \a value as a GLint and calls glUniform1i.
+
\sa setAttributeValue()
*/
void QOpenGLShaderProgram::setUniformValue(int location, GLuint value)
@@ -1986,6 +1989,9 @@ void QOpenGLShaderProgram::setUniformValue(int location, GLuint value)
Sets the uniform variable called \a name in the current context
to \a value. This function should be used when setting sampler values.
+ \note This function is not aware of unsigned int support in modern OpenGL
+ versions and therefore treats \a value as a GLint and calls glUniform1i.
+
\sa setAttributeValue()
*/
void QOpenGLShaderProgram::setUniformValue(const char *name, GLuint value)
@@ -2753,6 +2759,9 @@ void QOpenGLShaderProgram::setUniformValueArray
context to the \a count elements of \a values. This overload
should be used when setting an array of sampler values.
+ \note This function is not aware of unsigned int support in modern OpenGL
+ versions and therefore treats \a value as a GLint and calls glUniform1iv.
+
\sa setAttributeValue()
*/
void QOpenGLShaderProgram::setUniformValueArray(int location, const GLuint *values, int count)