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