73 explicit QOpenGLShaderProgram(QObject *parent =
nullptr);
74 ~QOpenGLShaderProgram();
76 bool addShader(QOpenGLShader *shader);
77 void removeShader(QOpenGLShader *shader);
78 QList<QOpenGLShader *> shaders()
const;
80 bool addShaderFromSourceCode(QOpenGLShader::ShaderType type,
const char *source);
81 bool addShaderFromSourceCode(QOpenGLShader::ShaderType type,
const QByteArray& source);
82 bool addShaderFromSourceCode(QOpenGLShader::ShaderType type,
const QString& source);
83 bool addShaderFromSourceFile(QOpenGLShader::ShaderType type,
const QString& fileName);
85 bool addCacheableShaderFromSourceCode(QOpenGLShader::ShaderType type,
const char *source);
86 bool addCacheableShaderFromSourceCode(QOpenGLShader::ShaderType type,
const QByteArray &source);
87 bool addCacheableShaderFromSourceCode(QOpenGLShader::ShaderType type,
const QString &source);
88 bool addCacheableShaderFromSourceFile(QOpenGLShader::ShaderType type,
const QString &fileName);
90 void removeAllShaders();
93 bool isLinked()
const;
101 GLuint programId()
const;
103 int maxGeometryOutputVertices()
const;
105 void setPatchVertexCount(
int count);
106 int patchVertexCount()
const;
108 void setDefaultOuterTessellationLevels(
const QList<
float> &levels);
109 QList<
float> defaultOuterTessellationLevels()
const;
111 void setDefaultInnerTessellationLevels(
const QList<
float> &levels);
112 QList<
float> defaultInnerTessellationLevels()
const;
114 void bindAttributeLocation(
const char *name,
int location);
115 void bindAttributeLocation(
const QByteArray& name,
int location);
116 void bindAttributeLocation(
const QString& name,
int location);
118 int attributeLocation(
const char *name)
const;
119 int attributeLocation(
const QByteArray& name)
const;
120 int attributeLocation(
const QString& name)
const;
122 void setAttributeValue(
int location, GLfloat value);
123 void setAttributeValue(
int location, GLfloat x, GLfloat y);
124 void setAttributeValue(
int location, GLfloat x, GLfloat y, GLfloat z);
125 void setAttributeValue(
int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
126 void setAttributeValue(
int location,
const QVector2D& value);
127 void setAttributeValue(
int location,
const QVector3D& value);
128 void setAttributeValue(
int location,
const QVector4D& value);
129 void setAttributeValue(
int location,
const QColor& value);
130 void setAttributeValue(
int location,
const GLfloat *values,
int columns,
int rows);
132 void setAttributeValue(
const char *name, GLfloat value);
133 void setAttributeValue(
const char *name, GLfloat x, GLfloat y);
134 void setAttributeValue(
const char *name, GLfloat x, GLfloat y, GLfloat z);
135 void setAttributeValue(
const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
136 void setAttributeValue(
const char *name,
const QVector2D& value);
137 void setAttributeValue(
const char *name,
const QVector3D& value);
138 void setAttributeValue(
const char *name,
const QVector4D& value);
139 void setAttributeValue(
const char *name,
const QColor& value);
140 void setAttributeValue(
const char *name,
const GLfloat *values,
int columns,
int rows);
142 void setAttributeArray
143 (
int location,
const GLfloat *values,
int tupleSize,
int stride = 0);
144 void setAttributeArray
145 (
int location,
const QVector2D *values,
int stride = 0);
146 void setAttributeArray
147 (
int location,
const QVector3D *values,
int stride = 0);
148 void setAttributeArray
149 (
int location,
const QVector4D *values,
int stride = 0);
150 void setAttributeArray
151 (
int location, GLenum type,
const void *values,
int tupleSize,
int stride = 0);
152 void setAttributeArray
153 (
const char *name,
const GLfloat *values,
int tupleSize,
int stride = 0);
154 void setAttributeArray
155 (
const char *name,
const QVector2D *values,
int stride = 0);
156 void setAttributeArray
157 (
const char *name,
const QVector3D *values,
int stride = 0);
158 void setAttributeArray
159 (
const char *name,
const QVector4D *values,
int stride = 0);
160 void setAttributeArray
161 (
const char *name, GLenum type,
const void *values,
int tupleSize,
int stride = 0);
163 void setAttributeBuffer
164 (
int location, GLenum type,
int offset,
int tupleSize,
int stride = 0);
165 void setAttributeBuffer
166 (
const char *name, GLenum type,
int offset,
int tupleSize,
int stride = 0);
168 void enableAttributeArray(
int location);
169 void enableAttributeArray(
const char *name);
170 void disableAttributeArray(
int location);
171 void disableAttributeArray(
const char *name);
173 int uniformLocation(
const char *name)
const;
174 int uniformLocation(
const QByteArray& name)
const;
175 int uniformLocation(
const QString& name)
const;
177 void setUniformValue(
int location, GLfloat value);
178 void setUniformValue(
int location, GLint value);
179 void setUniformValue(
int location, GLuint value);
180 void setUniformValue(
int location, GLfloat x, GLfloat y);
181 void setUniformValue(
int location, GLfloat x, GLfloat y, GLfloat z);
182 void setUniformValue(
int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
183 void setUniformValue(
int location,
const QVector2D& value);
184 void setUniformValue(
int location,
const QVector3D& value);
185 void setUniformValue(
int location,
const QVector4D& value);
186 void setUniformValue(
int location,
const QColor& color);
187 void setUniformValue(
int location,
const QPoint& point);
188 void setUniformValue(
int location,
const QPointF& point);
189 void setUniformValue(
int location,
const QSize& size);
190 void setUniformValue(
int location,
const QSizeF& size);
191 void setUniformValue(
int location,
const QMatrix2x2& value);
192 void setUniformValue(
int location,
const QMatrix2x3& value);
193 void setUniformValue(
int location,
const QMatrix2x4& value);
194 void setUniformValue(
int location,
const QMatrix3x2& value);
195 void setUniformValue(
int location,
const QMatrix3x3& value);
196 void setUniformValue(
int location,
const QMatrix3x4& value);
197 void setUniformValue(
int location,
const QMatrix4x2& value);
198 void setUniformValue(
int location,
const QMatrix4x3& value);
199 void setUniformValue(
int location,
const QMatrix4x4& value);
200 void setUniformValue(
int location,
const GLfloat value[2][2]);
201 void setUniformValue(
int location,
const GLfloat value[3][3]);
202 void setUniformValue(
int location,
const GLfloat value[4][4]);
203 void setUniformValue(
int location,
const QTransform& value);
205 void setUniformValue(
const char *name, GLfloat value);
206 void setUniformValue(
const char *name, GLint value);
207 void setUniformValue(
const char *name, GLuint value);
208 void setUniformValue(
const char *name, GLfloat x, GLfloat y);
209 void setUniformValue(
const char *name, GLfloat x, GLfloat y, GLfloat z);
210 void setUniformValue(
const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
211 void setUniformValue(
const char *name,
const QVector2D& value);
212 void setUniformValue(
const char *name,
const QVector3D& value);
213 void setUniformValue(
const char *name,
const QVector4D& value);
214 void setUniformValue(
const char *name,
const QColor& color);
215 void setUniformValue(
const char *name,
const QPoint& point);
216 void setUniformValue(
const char *name,
const QPointF& point);
217 void setUniformValue(
const char *name,
const QSize& size);
218 void setUniformValue(
const char *name,
const QSizeF& size);
219 void setUniformValue(
const char *name,
const QMatrix2x2& value);
220 void setUniformValue(
const char *name,
const QMatrix2x3& value);
221 void setUniformValue(
const char *name,
const QMatrix2x4& value);
222 void setUniformValue(
const char *name,
const QMatrix3x2& value);
223 void setUniformValue(
const char *name,
const QMatrix3x3& value);
224 void setUniformValue(
const char *name,
const QMatrix3x4& value);
225 void setUniformValue(
const char *name,
const QMatrix4x2& value);
226 void setUniformValue(
const char *name,
const QMatrix4x3& value);
227 void setUniformValue(
const char *name,
const QMatrix4x4& value);
228 void setUniformValue(
const char *name,
const GLfloat value[2][2]);
229 void setUniformValue(
const char *name,
const GLfloat value[3][3]);
230 void setUniformValue(
const char *name,
const GLfloat value[4][4]);
231 void setUniformValue(
const char *name,
const QTransform& value);
233 void setUniformValueArray(
int location,
const GLfloat *values,
int count,
int tupleSize);
234 void setUniformValueArray(
int location,
const GLint *values,
int count);
235 void setUniformValueArray(
int location,
const GLuint *values,
int count);
236 void setUniformValueArray(
int location,
const QVector2D *values,
int count);
237 void setUniformValueArray(
int location,
const QVector3D *values,
int count);
238 void setUniformValueArray(
int location,
const QVector4D *values,
int count);
239 void setUniformValueArray(
int location,
const QMatrix2x2 *values,
int count);
240 void setUniformValueArray(
int location,
const QMatrix2x3 *values,
int count);
241 void setUniformValueArray(
int location,
const QMatrix2x4 *values,
int count);
242 void setUniformValueArray(
int location,
const QMatrix3x2 *values,
int count);
243 void setUniformValueArray(
int location,
const QMatrix3x3 *values,
int count);
244 void setUniformValueArray(
int location,
const QMatrix3x4 *values,
int count);
245 void setUniformValueArray(
int location,
const QMatrix4x2 *values,
int count);
246 void setUniformValueArray(
int location,
const QMatrix4x3 *values,
int count);
247 void setUniformValueArray(
int location,
const QMatrix4x4 *values,
int count);
249 void setUniformValueArray(
const char *name,
const GLfloat *values,
int count,
int tupleSize);
250 void setUniformValueArray(
const char *name,
const GLint *values,
int count);
251 void setUniformValueArray(
const char *name,
const GLuint *values,
int count);
252 void setUniformValueArray(
const char *name,
const QVector2D *values,
int count);
253 void setUniformValueArray(
const char *name,
const QVector3D *values,
int count);
254 void setUniformValueArray(
const char *name,
const QVector4D *values,
int count);
255 void setUniformValueArray(
const char *name,
const QMatrix2x2 *values,
int count);
256 void setUniformValueArray(
const char *name,
const QMatrix2x3 *values,
int count);
257 void setUniformValueArray(
const char *name,
const QMatrix2x4 *values,
int count);
258 void setUniformValueArray(
const char *name,
const QMatrix3x2 *values,
int count);
259 void setUniformValueArray(
const char *name,
const QMatrix3x3 *values,
int count);
260 void setUniformValueArray(
const char *name,
const QMatrix3x4 *values,
int count);
261 void setUniformValueArray(
const char *name,
const QMatrix4x2 *values,
int count);
262 void setUniformValueArray(
const char *name,
const QMatrix4x3 *values,
int count);
263 void setUniformValueArray(
const char *name,
const QMatrix4x4 *values,
int count);
265 static bool hasOpenGLShaderPrograms(QOpenGLContext *context =
nullptr);
268 void shaderDestroyed();
271 Q_DISABLE_COPY(QOpenGLShaderProgram)
272 Q_DECLARE_PRIVATE(QOpenGLShaderProgram)