Revert "qt4: Updated to v4.7.3"
[openembedded.git] / recipes / qt4 / qt-4.6.0 / 1197-Add-GLfloat-2-2-GLfloat-3-3-uniform-setters-to-QGLSh.patch
1 From 2b4d3391fd922dfc5ac28815bbd5f36c4041b658 Mon Sep 17 00:00:00 2001
2 From: Tom Cooksey <thomas.cooksey@nokia.com>
3 Date: Mon, 21 Dec 2009 16:36:14 +0100
4 Subject: [PATCH 1197/1244] Add GLfloat[2][2] & GLfloat[3][3] uniform setters to QGLShaderProgram
5
6 Reviewed-By: Rhys Weatherley
7 ---
8  src/opengl/qglshaderprogram.cpp |   67 +++++++++++++++++++++++++++++++++++++++
9  src/opengl/qglshaderprogram.h   |    4 ++
10  2 files changed, 71 insertions(+), 0 deletions(-)
11
12 diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
13 index b4191dc..f9737a5 100644
14 --- a/src/opengl/qglshaderprogram.cpp
15 +++ b/src/opengl/qglshaderprogram.cpp
16 @@ -2275,6 +2275,42 @@ void QGLShaderProgram::setUniformValue(const char *name, const QMatrix4x4& value
17      \overload
18  
19      Sets the uniform variable at \a location in the current context
20 +    to a 2x2 matrix \a value.  The matrix elements must be specified
21 +    in column-major order.
22 +
23 +    \sa setAttributeValue()
24 +    \since 4.6.2
25 +*/
26 +void QGLShaderProgram::setUniformValue(int location, const GLfloat value[2][2])
27 +{
28 +    Q_D(QGLShaderProgram);
29 +    Q_UNUSED(d);
30 +    if (location != -1)
31 +        glUniformMatrix2fv(location, 1, GL_FALSE, value[0]);
32 +}
33 +
34 +/*!
35 +    \overload
36 +
37 +    Sets the uniform variable at \a location in the current context
38 +    to a 3x3 matrix \a value.  The matrix elements must be specified
39 +    in column-major order.
40 +
41 +    \sa setAttributeValue()
42 +    \since 4.6.2
43 +*/
44 +void QGLShaderProgram::setUniformValue(int location, const GLfloat value[3][3])
45 +{
46 +    Q_D(QGLShaderProgram);
47 +    Q_UNUSED(d);
48 +    if (location != -1)
49 +        glUniformMatrix3fv(location, 1, GL_FALSE, value[0]);
50 +}
51 +
52 +/*!
53 +    \overload
54 +
55 +    Sets the uniform variable at \a location in the current context
56      to a 4x4 matrix \a value.  The matrix elements must be specified
57      in column-major order.
58  
59 @@ -2288,6 +2324,37 @@ void QGLShaderProgram::setUniformValue(int location, const GLfloat value[4][4])
60          glUniformMatrix4fv(location, 1, GL_FALSE, value[0]);
61  }
62  
63 +
64 +/*!
65 +    \overload
66 +
67 +    Sets the uniform variable called \a name in the current context
68 +    to a 2x2 matrix \a value.  The matrix elements must be specified
69 +    in column-major order.
70 +
71 +    \sa setAttributeValue()
72 +    \since 4.6.2
73 +*/
74 +void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[2][2])
75 +{
76 +    setUniformValue(uniformLocation(name), value);
77 +}
78 +
79 +/*!
80 +    \overload
81 +
82 +    Sets the uniform variable called \a name in the current context
83 +    to a 3x3 matrix \a value.  The matrix elements must be specified
84 +    in column-major order.
85 +
86 +    \sa setAttributeValue()
87 +    \since 4.6.2
88 +*/
89 +void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[3][3])
90 +{
91 +    setUniformValue(uniformLocation(name), value);
92 +}
93 +
94  /*!
95      \overload
96  
97 diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
98 index deeaee2..4eb80dd 100644
99 --- a/src/opengl/qglshaderprogram.h
100 +++ b/src/opengl/qglshaderprogram.h
101 @@ -216,6 +216,8 @@ public:
102      void setUniformValue(int location, const QMatrix4x2& value);
103      void setUniformValue(int location, const QMatrix4x3& value);
104      void setUniformValue(int location, const QMatrix4x4& value);
105 +    void setUniformValue(int location, const GLfloat value[2][2]);
106 +    void setUniformValue(int location, const GLfloat value[3][3]);
107      void setUniformValue(int location, const GLfloat value[4][4]);
108      void setUniformValue(int location, const QTransform& value);
109  
110 @@ -242,6 +244,8 @@ public:
111      void setUniformValue(const char *name, const QMatrix4x2& value);
112      void setUniformValue(const char *name, const QMatrix4x3& value);
113      void setUniformValue(const char *name, const QMatrix4x4& value);
114 +    void setUniformValue(const char *name, const GLfloat value[2][2]);
115 +    void setUniformValue(const char *name, const GLfloat value[3][3]);
116      void setUniformValue(const char *name, const GLfloat value[4][4]);
117      void setUniformValue(const char *name, const QTransform& value);
118  
119 -- 
120 1.6.5
121