![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QOpenGLShaderProgram class allows OpenGL shader programs to be linked and used. More...
#include <qopenglshaderprogram.h>
Public Member Functions | |
QOpenGLShaderProgram (QObject *parent=nullptr) | |
Constructs a new shader program and attaches it to parent. | |
~QOpenGLShaderProgram () | |
Deletes this shader program. | |
bool | addShader (QOpenGLShader *shader) |
Adds a compiled shader to this shader program. | |
void | removeShader (QOpenGLShader *shader) |
Removes shader from this shader program. | |
QList< QOpenGLShader * > | shaders () const |
Returns a list of all shaders that have been added to this shader program using addShader(). | |
bool | addShaderFromSourceCode (QOpenGLShader::ShaderType type, const char *source) |
Compiles source as a shader of the specified type and adds it to this shader program. | |
bool | addShaderFromSourceCode (QOpenGLShader::ShaderType type, const QByteArray &source) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compiles source as a shader of the specified type and adds it to this shader program. | |
bool | addShaderFromSourceCode (QOpenGLShader::ShaderType type, const QString &source) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compiles source as a shader of the specified type and adds it to this shader program. | |
bool | addShaderFromSourceFile (QOpenGLShader::ShaderType type, const QString &fileName) |
Compiles the contents of fileName as a shader of the specified type and adds it to this shader program. | |
bool | addCacheableShaderFromSourceCode (QOpenGLShader::ShaderType type, const char *source) |
Registers the shader of the specified type and source to this program. | |
bool | addCacheableShaderFromSourceCode (QOpenGLShader::ShaderType type, const QByteArray &source) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Registers the shader of the specified type and source to this program. | |
bool | addCacheableShaderFromSourceCode (QOpenGLShader::ShaderType type, const QString &source) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Registers the shader of the specified type and source to this program. | |
bool | addCacheableShaderFromSourceFile (QOpenGLShader::ShaderType type, const QString &fileName) |
Registers the shader of the specified type and fileName to this program. | |
void | removeAllShaders () |
Removes all of the shaders that were added to this program previously. | |
virtual bool | link () |
Links together the shaders that were added to this program with addShader(). | |
bool | isLinked () const |
Returns true if this shader program has been linked; false otherwise. | |
QString | log () const |
Returns the errors and warnings that occurred during the last link() or addShader() with explicitly specified source code. | |
bool | bind () |
Binds this shader program to the active QOpenGLContext and makes it the current shader program. | |
void | release () |
Releases the active shader program from the current QOpenGLContext. | |
bool | create () |
Requests the shader program's id to be created immediately. | |
GLuint | programId () const |
Returns the OpenGL identifier associated with this shader program. | |
int | maxGeometryOutputVertices () const |
Returns the hardware limit for how many vertices a geometry shader can output. | |
void | setPatchVertexCount (int count) |
Use this function to specify to OpenGL the number of vertices in a patch to count. | |
int | patchVertexCount () const |
Returns the number of vertices per-patch to be used when rendering. | |
void | setDefaultOuterTessellationLevels (const QList< float > &levels) |
Sets the default outer tessellation levels to be used by the tessellation primitive generator in the event that the tessellation control shader does not output them to levels. | |
QList< float > | defaultOuterTessellationLevels () const |
Returns the default outer tessellation levels to be used by the tessellation primitive generator in the event that the tessellation control shader does not output them. | |
void | setDefaultInnerTessellationLevels (const QList< float > &levels) |
Sets the default outer tessellation levels to be used by the tessellation primitive generator in the event that the tessellation control shader does not output them to levels. | |
QList< float > | defaultInnerTessellationLevels () const |
Returns the default inner tessellation levels to be used by the tessellation primitive generator in the event that the tessellation control shader does not output them. | |
void | bindAttributeLocation (const char *name, int location) |
Binds the attribute name to the specified location. | |
void | bindAttributeLocation (const QByteArray &name, int location) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Binds the attribute name to the specified location. | |
void | bindAttributeLocation (const QString &name, int location) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Binds the attribute name to the specified location. | |
int | attributeLocation (const char *name) const |
Returns the location of the attribute name within this shader program's parameter list. | |
int | attributeLocation (const QByteArray &name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the location of the attribute name within this shader program's parameter list. | |
int | attributeLocation (const QString &name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the location of the attribute name within this shader program's parameter list. | |
void | setAttributeValue (int location, GLfloat value) |
Sets the attribute at location in the current context to value. | |
void | setAttributeValue (int location, GLfloat x, GLfloat y) |
Sets the attribute at location in the current context to the 2D vector (x, y). | |
void | setAttributeValue (int location, GLfloat x, GLfloat y, GLfloat z) |
Sets the attribute at location in the current context to the 3D vector (x, y, z). | |
void | setAttributeValue (int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) |
Sets the attribute at location in the current context to the 4D vector (x, y, z, w). | |
void | setAttributeValue (int location, const QVector2D &value) |
Sets the attribute at location in the current context to value. | |
void | setAttributeValue (int location, const QVector3D &value) |
Sets the attribute at location in the current context to value. | |
void | setAttributeValue (int location, const QVector4D &value) |
Sets the attribute at location in the current context to value. | |
void | setAttributeValue (int location, const QColor &value) |
Sets the attribute at location in the current context to value. | |
void | setAttributeValue (int location, const GLfloat *values, int columns, int rows) |
Sets the attribute at location in the current context to the contents of values, which contains columns elements, each consisting of rows elements. | |
void | setAttributeValue (const char *name, GLfloat value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value. | |
void | setAttributeValue (const char *name, GLfloat x, GLfloat y) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to the 2D vector (x, y). | |
void | setAttributeValue (const char *name, GLfloat x, GLfloat y, GLfloat z) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to the 3D vector (x, y, z). | |
void | setAttributeValue (const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to the 4D vector (x, y, z, w). | |
void | setAttributeValue (const char *name, const QVector2D &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value. | |
void | setAttributeValue (const char *name, const QVector3D &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value. | |
void | setAttributeValue (const char *name, const QVector4D &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value. | |
void | setAttributeValue (const char *name, const QColor &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value. | |
void | setAttributeValue (const char *name, const GLfloat *values, int columns, int rows) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to the contents of values, which contains columns elements, each consisting of rows elements. | |
void | setAttributeArray (int location, const GLfloat *values, int tupleSize, int stride=0) |
Sets an array of vertex values on the attribute at location in this shader program. | |
void | setAttributeArray (int location, const QVector2D *values, int stride=0) |
Sets an array of 2D vertex values on the attribute at location in this shader program. | |
void | setAttributeArray (int location, const QVector3D *values, int stride=0) |
Sets an array of 3D vertex values on the attribute at location in this shader program. | |
void | setAttributeArray (int location, const QVector4D *values, int stride=0) |
Sets an array of 4D vertex values on the attribute at location in this shader program. | |
void | setAttributeArray (int location, GLenum type, const void *values, int tupleSize, int stride=0) |
Sets an array of vertex values on the attribute at location in this shader program. | |
void | setAttributeArray (const char *name, const GLfloat *values, int tupleSize, int stride=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of vertex values on the attribute called name in this shader program. | |
void | setAttributeArray (const char *name, const QVector2D *values, int stride=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of 2D vertex values on the attribute called name in this shader program. | |
void | setAttributeArray (const char *name, const QVector3D *values, int stride=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of 3D vertex values on the attribute called name in this shader program. | |
void | setAttributeArray (const char *name, const QVector4D *values, int stride=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of 4D vertex values on the attribute called name in this shader program. | |
void | setAttributeArray (const char *name, GLenum type, const void *values, int tupleSize, int stride=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of vertex values on the attribute called name in this shader program. | |
void | setAttributeBuffer (int location, GLenum type, int offset, int tupleSize, int stride=0) |
Sets an array of vertex values on the attribute at location in this shader program, starting at a specific offset in the currently bound vertex buffer. | |
void | setAttributeBuffer (const char *name, GLenum type, int offset, int tupleSize, int stride=0) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of vertex values on the attribute called name in this shader program, starting at a specific offset in the currently bound vertex buffer. | |
void | enableAttributeArray (int location) |
Enables the vertex array at location in this shader program so that the value set by setAttributeArray() on location will be used by the shader program. | |
void | enableAttributeArray (const char *name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Enables the vertex array called name in this shader program so that the value set by setAttributeArray() on name will be used by the shader program. | |
void | disableAttributeArray (int location) |
Disables the vertex array at location in this shader program that was enabled by a previous call to enableAttributeArray(). | |
void | disableAttributeArray (const char *name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Disables the vertex array called name in this shader program that was enabled by a previous call to enableAttributeArray(). | |
int | uniformLocation (const char *name) const |
Returns the location of the uniform variable name within this shader program's parameter list. | |
int | uniformLocation (const QByteArray &name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the location of the uniform variable name within this shader program's parameter list. | |
int | uniformLocation (const QString &name) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the location of the uniform variable name within this shader program's parameter list. | |
void | setUniformValue (int location, GLfloat value) |
Sets the uniform variable at location in the current context to value. | |
void | setUniformValue (int location, GLint value) |
Sets the uniform variable at location in the current context to value. | |
void | setUniformValue (int location, GLuint value) |
Sets the uniform variable at location in the current context to value. | |
void | setUniformValue (int location, GLfloat x, GLfloat y) |
Sets the uniform variable at location in the current context to the 2D vector (x, y). | |
void | setUniformValue (int location, GLfloat x, GLfloat y, GLfloat z) |
Sets the uniform variable at location in the current context to the 3D vector (x, y, z). | |
void | setUniformValue (int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) |
Sets the uniform variable at location in the current context to the 4D vector (x, y, z, w). | |
void | setUniformValue (int location, const QVector2D &value) |
Sets the uniform variable at location in the current context to value. | |
void | setUniformValue (int location, const QVector3D &value) |
Sets the uniform variable at location in the current context to value. | |
void | setUniformValue (int location, const QVector4D &value) |
Sets the uniform variable at location in the current context to value. | |
void | setUniformValue (int location, const QColor &color) |
Sets the uniform variable at location in the current context to the red, green, blue, and alpha components of color. | |
void | setUniformValue (int location, const QPoint &point) |
Sets the uniform variable at location in the current context to the x and y coordinates of point. | |
void | setUniformValue (int location, const QPointF &point) |
Sets the uniform variable at location in the current context to the x and y coordinates of point. | |
void | setUniformValue (int location, const QSize &size) |
Sets the uniform variable at location in the current context to the width and height of the given size. | |
void | setUniformValue (int location, const QSizeF &size) |
Sets the uniform variable at location in the current context to the width and height of the given size. | |
void | setUniformValue (int location, const QMatrix2x2 &value) |
Sets the uniform variable at location in the current context to a 2x2 matrix value. | |
void | setUniformValue (int location, const QMatrix2x3 &value) |
Sets the uniform variable at location in the current context to a 2x3 matrix value. | |
void | setUniformValue (int location, const QMatrix2x4 &value) |
Sets the uniform variable at location in the current context to a 2x4 matrix value. | |
void | setUniformValue (int location, const QMatrix3x2 &value) |
Sets the uniform variable at location in the current context to a 3x2 matrix value. | |
void | setUniformValue (int location, const QMatrix3x3 &value) |
Sets the uniform variable at location in the current context to a 3x3 matrix value. | |
void | setUniformValue (int location, const QMatrix3x4 &value) |
Sets the uniform variable at location in the current context to a 3x4 matrix value. | |
void | setUniformValue (int location, const QMatrix4x2 &value) |
Sets the uniform variable at location in the current context to a 4x2 matrix value. | |
void | setUniformValue (int location, const QMatrix4x3 &value) |
Sets the uniform variable at location in the current context to a 4x3 matrix value. | |
void | setUniformValue (int location, const QMatrix4x4 &value) |
Sets the uniform variable at location in the current context to a 4x4 matrix value. | |
void | setUniformValue (int location, const GLfloat value[2][2]) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable at location in the current context to a 2x2 matrix value. | |
void | setUniformValue (int location, const GLfloat value[3][3]) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable at location in the current context to a 3x3 matrix value. | |
void | setUniformValue (int location, const GLfloat value[4][4]) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable at location in the current context to a 4x4 matrix value. | |
void | setUniformValue (int location, const QTransform &value) |
Sets the uniform variable at location in the current context to a 3x3 transformation matrix value that is specified as a QTransform value. | |
void | setUniformValue (const char *name, GLfloat value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value. | |
void | setUniformValue (const char *name, GLint value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value. | |
void | setUniformValue (const char *name, GLuint value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value. | |
void | setUniformValue (const char *name, GLfloat x, GLfloat y) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to the 2D vector (x, y). | |
void | setUniformValue (const char *name, GLfloat x, GLfloat y, GLfloat z) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to the 3D vector (x, y, z). | |
void | setUniformValue (const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to the 4D vector (x, y, z, w). | |
void | setUniformValue (const char *name, const QVector2D &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value. | |
void | setUniformValue (const char *name, const QVector3D &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value. | |
void | setUniformValue (const char *name, const QVector4D &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value. | |
void | setUniformValue (const char *name, const QColor &color) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to the red, green, blue, and alpha components of color. | |
void | setUniformValue (const char *name, const QPoint &point) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable associated with name in the current context to the x and y coordinates of point. | |
void | setUniformValue (const char *name, const QPointF &point) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable associated with name in the current context to the x and y coordinates of point. | |
void | setUniformValue (const char *name, const QSize &size) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable associated with name in the current context to the width and height of the given size. | |
void | setUniformValue (const char *name, const QSizeF &size) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable associated with name in the current context to the width and height of the given size. | |
void | setUniformValue (const char *name, const QMatrix2x2 &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 2x2 matrix value. | |
void | setUniformValue (const char *name, const QMatrix2x3 &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 2x3 matrix value. | |
void | setUniformValue (const char *name, const QMatrix2x4 &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 2x4 matrix value. | |
void | setUniformValue (const char *name, const QMatrix3x2 &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x2 matrix value. | |
void | setUniformValue (const char *name, const QMatrix3x3 &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x3 matrix value. | |
void | setUniformValue (const char *name, const QMatrix3x4 &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x4 matrix value. | |
void | setUniformValue (const char *name, const QMatrix4x2 &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 4x2 matrix value. | |
void | setUniformValue (const char *name, const QMatrix4x3 &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 4x3 matrix value. | |
void | setUniformValue (const char *name, const QMatrix4x4 &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 4x4 matrix value. | |
void | setUniformValue (const char *name, const GLfloat value[2][2]) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 2x2 matrix value. | |
void | setUniformValue (const char *name, const GLfloat value[3][3]) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x3 matrix value. | |
void | setUniformValue (const char *name, const GLfloat value[4][4]) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 4x4 matrix value. | |
void | setUniformValue (const char *name, const QTransform &value) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x3 transformation matrix value that is specified as a QTransform value. | |
void | setUniformValueArray (int location, const GLfloat *values, int count, int tupleSize) |
Sets the uniform variable array at location in the current context to the count elements of values. | |
void | setUniformValueArray (int location, const GLint *values, int count) |
Sets the uniform variable array at location in the current context to the count elements of values. | |
void | setUniformValueArray (int location, const GLuint *values, int count) |
Sets the uniform variable array at location in the current context to the count elements of values. | |
void | setUniformValueArray (int location, const QVector2D *values, int count) |
Sets the uniform variable array at location in the current context to the count 2D vector elements of values. | |
void | setUniformValueArray (int location, const QVector3D *values, int count) |
Sets the uniform variable array at location in the current context to the count 3D vector elements of values. | |
void | setUniformValueArray (int location, const QVector4D *values, int count) |
Sets the uniform variable array at location in the current context to the count 4D vector elements of values. | |
void | setUniformValueArray (int location, const QMatrix2x2 *values, int count) |
Sets the uniform variable array at location in the current context to the count 2x2 matrix elements of values. | |
void | setUniformValueArray (int location, const QMatrix2x3 *values, int count) |
Sets the uniform variable array at location in the current context to the count 2x3 matrix elements of values. | |
void | setUniformValueArray (int location, const QMatrix2x4 *values, int count) |
Sets the uniform variable array at location in the current context to the count 2x4 matrix elements of values. | |
void | setUniformValueArray (int location, const QMatrix3x2 *values, int count) |
Sets the uniform variable array at location in the current context to the count 3x2 matrix elements of values. | |
void | setUniformValueArray (int location, const QMatrix3x3 *values, int count) |
Sets the uniform variable array at location in the current context to the count 3x3 matrix elements of values. | |
void | setUniformValueArray (int location, const QMatrix3x4 *values, int count) |
Sets the uniform variable array at location in the current context to the count 3x4 matrix elements of values. | |
void | setUniformValueArray (int location, const QMatrix4x2 *values, int count) |
Sets the uniform variable array at location in the current context to the count 4x2 matrix elements of values. | |
void | setUniformValueArray (int location, const QMatrix4x3 *values, int count) |
Sets the uniform variable array at location in the current context to the count 4x3 matrix elements of values. | |
void | setUniformValueArray (int location, const QMatrix4x4 *values, int count) |
Sets the uniform variable array at location in the current context to the count 4x4 matrix elements of values. | |
void | setUniformValueArray (const char *name, const GLfloat *values, int count, int tupleSize) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count elements of values. | |
void | setUniformValueArray (const char *name, const GLint *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count elements of values. | |
void | setUniformValueArray (const char *name, const GLuint *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count elements of values. | |
void | setUniformValueArray (const char *name, const QVector2D *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 2D vector elements of values. | |
void | setUniformValueArray (const char *name, const QVector3D *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 3D vector elements of values. | |
void | setUniformValueArray (const char *name, const QVector4D *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 4D vector elements of values. | |
void | setUniformValueArray (const char *name, const QMatrix2x2 *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 2x2 matrix elements of values. | |
void | setUniformValueArray (const char *name, const QMatrix2x3 *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 2x3 matrix elements of values. | |
void | setUniformValueArray (const char *name, const QMatrix2x4 *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 2x4 matrix elements of values. | |
void | setUniformValueArray (const char *name, const QMatrix3x2 *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 3x2 matrix elements of values. | |
void | setUniformValueArray (const char *name, const QMatrix3x3 *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 3x3 matrix elements of values. | |
void | setUniformValueArray (const char *name, const QMatrix3x4 *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 3x4 matrix elements of values. | |
void | setUniformValueArray (const char *name, const QMatrix4x2 *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 4x2 matrix elements of values. | |
void | setUniformValueArray (const char *name, const QMatrix4x3 *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 4x3 matrix elements of values. | |
void | setUniformValueArray (const char *name, const QMatrix4x4 *values, int count) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 4x4 matrix elements of values. | |
Public Member Functions inherited from QObject | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | isQmlObjectType () const |
Returns whether the object has been created by the QML engine or ownership has been explicitly set via QJSEngine::setObjectOwnership(). | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
bool | moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL) |
Changes the thread affinity for this object and its children and returns true on success. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
void | killTimer (Qt::TimerId id) |
template<typename T> | |
T | findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T> | |
QList< T > | findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T> | |
T | findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename T> | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . |
Static Public Member Functions | |
static bool | hasOpenGLShaderPrograms (QOpenGLContext *context=nullptr) |
Returns true if shader programs written in the OpenGL Shading Language (GLSL) are supported on this system; false otherwise. | |
Static Public Member Functions inherited from QObject | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1, typename Func2> | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1, typename Func2> | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1, typename Func2> | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1> | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
Additional Inherited Members | |
Public Slots inherited from QObject | |
void | deleteLater () |
\threadsafe | |
Signals inherited from QObject | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Protected Attributes inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Properties inherited from QObject | |
QString | objectName |
the name of this object | |
Related Symbols inherited from QObject | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) |
The QOpenGLShaderProgram class allows OpenGL shader programs to be linked and used.
\inmodule QtOpenGL
Definition at line 69 of file qopenglshaderprogram.h.
|
explicit |
Constructs a new shader program and attaches it to parent.
The program will be invalid until addShader() is called.
The shader program will be associated with the current QOpenGLContext.
Definition at line 842 of file qopenglshaderprogram.cpp.
QOpenGLShaderProgram::~QOpenGLShaderProgram | ( | ) |
Deletes this shader program.
Definition at line 850 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::addCacheableShaderFromSourceCode | ( | QOpenGLShader::ShaderType | type, |
const char * | source ) |
Registers the shader of the specified type and source to this program.
Unlike addShaderFromSourceCode(), this function does not perform compilation. Compilation is deferred to link(), and may not happen at all, because link() may potentially use a program binary from Qt's shader disk cache. This will typically lead to a significant increase in performance.
When the disk cache is disabled, via Qt::AA_DisableShaderDiskCache for example, or the OpenGL context has no support for context binaries, calling this function is equivalent to addShaderFromSourceCode().
Definition at line 1053 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::addCacheableShaderFromSourceCode | ( | QOpenGLShader::ShaderType | type, |
const QByteArray & | source ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Registers the shader of the specified type and source to this program.
Unlike addShaderFromSourceCode(), this function does not perform compilation. Compilation is deferred to link(), and may not happen at all, because link() may potentially use a program binary from Qt's shader disk cache. This will typically lead to a significant increase in performance.
When the disk cache is disabled, via Qt::AA_DisableShaderDiskCache for example, or the OpenGL context has no support for context binaries, calling this function is equivalent to addShaderFromSourceCode().
Definition at line 1122 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::addCacheableShaderFromSourceCode | ( | QOpenGLShader::ShaderType | type, |
const QString & | source ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Registers the shader of the specified type and source to this program.
Unlike addShaderFromSourceCode(), this function does not perform compilation. Compilation is deferred to link(), and may not happen at all, because link() may potentially use a program binary from Qt's shader disk cache. This will typically lead to a significant increase in performance.
When the disk cache is disabled, via Qt::AA_DisableShaderDiskCache for example, or the OpenGL context has no support for context binaries, calling this function is equivalent to addShaderFromSourceCode().
Definition at line 1150 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::addCacheableShaderFromSourceFile | ( | QOpenGLShader::ShaderType | type, |
const QString & | fileName ) |
Registers the shader of the specified type and fileName to this program.
Unlike addShaderFromSourceFile(), this function does not perform compilation. Compilation is deferred to link(), and may not happen at all, because link() may potentially use a program binary from Qt's shader disk cache. This will typically lead to a significant increase in performance.
When the disk cache is disabled, via Qt::AA_DisableShaderDiskCache for example, or the OpenGL context has no support for context binaries, calling this function is equivalent to addShaderFromSourceFile().
Definition at line 1179 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::addShader | ( | QOpenGLShader * | shader | ) |
Adds a compiled shader to this shader program.
Returns true
if the shader could be added, or false otherwise.
Ownership of the shader object remains with the caller. It will not be deleted when this QOpenGLShaderProgram instance is deleted. This allows the caller to add the same shader to multiple shader programs.
Definition at line 915 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::addShaderFromSourceCode | ( | QOpenGLShader::ShaderType | type, |
const char * | source ) |
Compiles source as a shader of the specified type and adds it to this shader program.
Returns true
if compilation was successful, false otherwise. The compilation errors and warnings will be made available via log().
This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance of QOpenGLShader first.
Definition at line 952 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::addShaderFromSourceCode | ( | QOpenGLShader::ShaderType | type, |
const QByteArray & | source ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compiles source as a shader of the specified type and adds it to this shader program.
Returns true
if compilation was successful, false otherwise. The compilation errors and warnings will be made available via log().
This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance of QOpenGLShader first.
Definition at line 982 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::addShaderFromSourceCode | ( | QOpenGLShader::ShaderType | type, |
const QString & | source ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compiles source as a shader of the specified type and adds it to this shader program.
Returns true
if compilation was successful, false otherwise. The compilation errors and warnings will be made available via log().
This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance of QOpenGLShader first.
Definition at line 1002 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::addShaderFromSourceFile | ( | QOpenGLShader::ShaderType | type, |
const QString & | fileName ) |
Compiles the contents of fileName as a shader of the specified type and adds it to this shader program.
Returns true
if compilation was successful, false otherwise. The compilation errors and warnings will be made available via log().
This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance of QOpenGLShader first.
Definition at line 1019 of file qopenglshaderprogram.cpp.
int QOpenGLShaderProgram::attributeLocation | ( | const char * | name | ) | const |
Returns the location of the attribute name within this shader program's parameter list.
Returns -1 if name is not a valid attribute for this shader program.
Definition at line 1492 of file qopenglshaderprogram.cpp.
int QOpenGLShaderProgram::attributeLocation | ( | const QByteArray & | name | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the location of the attribute name within this shader program's parameter list.
Returns -1 if name is not a valid attribute for this shader program.
Definition at line 1512 of file qopenglshaderprogram.cpp.
int QOpenGLShaderProgram::attributeLocation | ( | const QString & | name | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the location of the attribute name within this shader program's parameter list.
Returns -1 if name is not a valid attribute for this shader program.
Definition at line 1526 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::bind | ( | ) |
Binds this shader program to the active QOpenGLContext and makes it the current shader program.
Any previously bound shader program is released. This is equivalent to calling {glUseProgram()} on programId(). Returns
true
if the program was successfully bound; false otherwise. If the shader program has not yet been linked, or it needs to be re-linked, this function will call link().
Definition at line 1375 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::bindAttributeLocation | ( | const char * | name, |
int | location ) |
Binds the attribute name to the specified location.
This function can be called before or after the program has been linked. Any attributes that have not been explicitly bound when the program is linked will be assigned locations automatically.
When this function is called after the program has been linked, the program will need to be relinked for the change to take effect.
Definition at line 1440 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::bindAttributeLocation | ( | const QByteArray & | name, |
int | location ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Binds the attribute name to the specified location.
This function can be called before or after the program has been linked. Any attributes that have not been explicitly bound when the program is linked will be assigned locations automatically.
When this function is called after the program has been linked, the program will need to be relinked for the change to take effect.
Definition at line 1462 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Binds the attribute name to the specified location.
This function can be called before or after the program has been linked. Any attributes that have not been explicitly bound when the program is linked will be assigned locations automatically.
When this function is called after the program has been linked, the program will need to be relinked for the change to take effect.
Definition at line 1480 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::create | ( | ) |
Requests the shader program's id to be created immediately.
Returns true
if successful; false
otherwise.
This function is primarily useful when combining QOpenGLShaderProgram with other OpenGL functions that operate directly on the shader program id, like {GL_OES_get_program_binary}
.
When the shader program is used normally, the shader program's id will be created on demand.
Definition at line 869 of file qopenglshaderprogram.cpp.
QList< float > QOpenGLShaderProgram::defaultInnerTessellationLevels | ( | ) | const |
Returns the default inner tessellation levels to be used by the tessellation primitive generator in the event that the tessellation control shader does not output them.
For more details on OpenGL and Tessellation shaders see \l{OpenGL Tessellation Shaders}.
Returns a QList of floats describing the inner tessellation levels. The vector will always have two elements but not all of them make sense for every mode of tessellation.
Definition at line 3669 of file qopenglshaderprogram.cpp.
QList< float > QOpenGLShaderProgram::defaultOuterTessellationLevels | ( | ) | const |
Returns the default outer tessellation levels to be used by the tessellation primitive generator in the event that the tessellation control shader does not output them.
For more details on OpenGL and Tessellation shaders see \l{OpenGL Tessellation Shaders}.
Returns a QList of floats describing the outer tessellation levels. The vector will always have four elements but not all of them make sense for every mode of tessellation.
Definition at line 3596 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::disableAttributeArray | ( | const char * | name | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Disables the vertex array called name in this shader program that was enabled by a previous call to enableAttributeArray().
Definition at line 2154 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::disableAttributeArray | ( | int | location | ) |
Disables the vertex array at location in this shader program that was enabled by a previous call to enableAttributeArray().
Definition at line 2137 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::enableAttributeArray | ( | const char * | name | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Enables the vertex array called name in this shader program so that the value set by setAttributeArray() on name will be used by the shader program.
Definition at line 2125 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::enableAttributeArray | ( | int | location | ) |
Enables the vertex array at location in this shader program so that the value set by setAttributeArray() on location will be used by the shader program.
Definition at line 2107 of file qopenglshaderprogram.cpp.
|
static |
Returns true
if shader programs written in the OpenGL Shading Language (GLSL) are supported on this system; false otherwise.
The context is used to resolve the GLSL extensions. If context is \nullptr, then QOpenGLContext::currentContext() is used.
Definition at line 3691 of file qopenglshaderprogram.cpp.
bool QOpenGLShaderProgram::isLinked | ( | ) | const |
Returns true
if this shader program has been linked; false otherwise.
Definition at line 1347 of file qopenglshaderprogram.cpp.
|
virtual |
Links together the shaders that were added to this program with addShader().
Returns true
if the link was successful or false otherwise. If the link failed, the error messages can be retrieved with log().
Subclasses can override this function to initialize attributes and uniform variables for use in specific shader programs.
If the shader program was already linked, calling this function again will force it to be re-linked.
When shaders were added to this program via addCacheableShaderFromSourceCode() or addCacheableShaderFromSourceFile(), program binaries are supported, and a cached binary is available on disk, actual compilation and linking are skipped. Instead, link() will initialize the program with the binary blob via glProgramBinary(). If there is no cached version of the program or it was generated with a different driver version, the shaders will be compiled from source and the program will get linked normally. This allows seamless upgrading of the graphics drivers, without having to worry about potentially incompatible binary formats.
Definition at line 1293 of file qopenglshaderprogram.cpp.
QString QOpenGLShaderProgram::log | ( | ) | const |
Returns the errors and warnings that occurred during the last link() or addShader() with explicitly specified source code.
Definition at line 1359 of file qopenglshaderprogram.cpp.
int QOpenGLShaderProgram::maxGeometryOutputVertices | ( | ) | const |
Returns the hardware limit for how many vertices a geometry shader can output.
Definition at line 3488 of file qopenglshaderprogram.cpp.
int QOpenGLShaderProgram::patchVertexCount | ( | ) | const |
Returns the number of vertices per-patch to be used when rendering.
Definition at line 3528 of file qopenglshaderprogram.cpp.
GLuint QOpenGLShaderProgram::programId | ( | ) | const |
Returns the OpenGL identifier associated with this shader program.
Definition at line 1414 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::release | ( | ) |
Releases the active shader program from the current QOpenGLContext.
This is equivalent to calling {glUseProgram(0)}.
Definition at line 1399 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::removeAllShaders | ( | ) |
Removes all of the shaders that were added to this program previously.
The QOpenGLShader objects for the shaders will not be deleted if they were constructed externally. QOpenGLShader objects that are constructed internally by QOpenGLShaderProgram will be deleted.
Definition at line 1249 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::removeShader | ( | QOpenGLShader * | shader | ) |
Removes shader from this shader program.
The object is not deleted.
The shader program must be valid in the current QOpenGLContext.
Definition at line 1213 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | const char * | name, |
const GLfloat * | values, | ||
int | tupleSize, | ||
int | stride = 0 ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of vertex values on the attribute called name in this shader program.
The tupleSize indicates the number of components per vertex (1, 2, 3, or 4), and the stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The array will become active when enableAttributeArray() is called on name. Otherwise the value specified with setAttributeValue() for name will be used.
Definition at line 1944 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | const char * | name, |
const QVector2D * | values, | ||
int | stride = 0 ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of 2D vertex values on the attribute called name in this shader program.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The array will become active when enableAttributeArray() is called on name. Otherwise the value specified with setAttributeValue() for name will be used.
Definition at line 1965 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | const char * | name, |
const QVector3D * | values, | ||
int | stride = 0 ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of 3D vertex values on the attribute called name in this shader program.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The array will become active when enableAttributeArray() is called on name. Otherwise the value specified with setAttributeValue() for name will be used.
Definition at line 1986 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | const char * | name, |
const QVector4D * | values, | ||
int | stride = 0 ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of 4D vertex values on the attribute called name in this shader program.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The array will become active when enableAttributeArray() is called on name. Otherwise the value specified with setAttributeValue() for name will be used.
Definition at line 2007 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | const char * | name, |
GLenum | type, | ||
const void * | values, | ||
int | tupleSize, | ||
int | stride = 0 ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of vertex values on the attribute called name in this shader program.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The type indicates the type of elements in the values array, usually {GL_FLOAT},
{GL_UNSIGNED_BYTE}, etc. The tupleSize indicates the number of components per vertex: 1, 2, 3, or 4.
The array will become active when enableAttributeArray() is called on the name. Otherwise the value specified with setAttributeValue() for name will be used.
The setAttributeBuffer() function can be used to set the attribute array to an offset within a vertex buffer.
Definition at line 2035 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | int | location, |
const GLfloat * | values, | ||
int | tupleSize, | ||
int | stride = 0 ) |
Sets an array of vertex values on the attribute at location in this shader program.
The tupleSize indicates the number of components per vertex (1, 2, 3, or 4), and the stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The array will become active when enableAttributeArray() is called on the location. Otherwise the value specified with setAttributeValue() for location will be used.
Definition at line 1811 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | int | location, |
const QVector2D * | values, | ||
int | stride = 0 ) |
Sets an array of 2D vertex values on the attribute at location in this shader program.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The array will become active when enableAttributeArray() is called on the location. Otherwise the value specified with setAttributeValue() for location will be used.
Definition at line 1835 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | int | location, |
const QVector3D * | values, | ||
int | stride = 0 ) |
Sets an array of 3D vertex values on the attribute at location in this shader program.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The array will become active when enableAttributeArray() is called on the location. Otherwise the value specified with setAttributeValue() for location will be used.
Definition at line 1859 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | int | location, |
const QVector4D * | values, | ||
int | stride = 0 ) |
Sets an array of 4D vertex values on the attribute at location in this shader program.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The array will become active when enableAttributeArray() is called on the location. Otherwise the value specified with setAttributeValue() for location will be used.
Definition at line 1883 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeArray | ( | int | location, |
GLenum | type, | ||
const void * | values, | ||
int | tupleSize, | ||
int | stride = 0 ) |
Sets an array of vertex values on the attribute at location in this shader program.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in values.
The type indicates the type of elements in the values array, usually {GL_FLOAT},
{GL_UNSIGNED_BYTE}, etc. The tupleSize indicates the number of components per vertex: 1, 2, 3, or 4.
The array will become active when enableAttributeArray() is called on the location. Otherwise the value specified with setAttributeValue() for location will be used.
The setAttributeBuffer() function can be used to set the attribute array to an offset within a vertex buffer.
Definition at line 1917 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeBuffer | ( | const char * | name, |
GLenum | type, | ||
int | offset, | ||
int | tupleSize, | ||
int | stride = 0 ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets an array of vertex values on the attribute called name in this shader program, starting at a specific offset in the currently bound vertex buffer.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in the value array.
The type indicates the type of elements in the vertex value array, usually {GL_FLOAT},
{GL_UNSIGNED_BYTE}, etc. The tupleSize indicates the number of components per vertex: 1, 2, 3, or 4.
The array will become active when enableAttributeArray() is called on the name. Otherwise the value specified with setAttributeValue() for name will be used.
Definition at line 2093 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeBuffer | ( | int | location, |
GLenum | type, | ||
int | offset, | ||
int | tupleSize, | ||
int | stride = 0 ) |
Sets an array of vertex values on the attribute at location in this shader program, starting at a specific offset in the currently bound vertex buffer.
The stride indicates the number of bytes between vertices. A default stride value of zero indicates that the vertices are densely packed in the value array.
The type indicates the type of elements in the vertex value array, usually {GL_FLOAT},
{GL_UNSIGNED_BYTE}, etc. The tupleSize indicates the number of components per vertex: 1, 2, 3, or 4.
The array will become active when enableAttributeArray() is called on the location. Otherwise the value specified with setAttributeValue() for location will be used.
Definition at line 2062 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeValue | ( | const char * | name, |
const GLfloat * | values, | ||
int | columns, | ||
int | rows ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to the contents of values, which contains columns elements, each consisting of rows elements.
The rows value should be 1, 2, 3, or 4. This function is typically used to set matrix values and column vectors.
Definition at line 1791 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value.
Definition at line 1741 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value.
Definition at line 1663 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value.
Definition at line 1688 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value.
Definition at line 1713 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to value.
Definition at line 1550 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to the 2D vector (x, y).
Definition at line 1578 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to the 3D vector (x, y, z).
Definition at line 1608 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeValue | ( | const char * | name, |
GLfloat | x, | ||
GLfloat | y, | ||
GLfloat | z, | ||
GLfloat | w ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the attribute called name in the current context to the 4D vector (x, y, z, w).
Definition at line 1638 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeValue | ( | int | location, |
const GLfloat * | values, | ||
int | columns, | ||
int | rows ) |
Sets the attribute at location in the current context to the contents of values, which contains columns elements, each consisting of rows elements.
The rows value should be 1, 2, 3, or 4. This function is typically used to set matrix values and column vectors.
Definition at line 1755 of file qopenglshaderprogram.cpp.
Sets the attribute at location in the current context to value.
Definition at line 1723 of file qopenglshaderprogram.cpp.
Sets the attribute at location in the current context to value.
Definition at line 1649 of file qopenglshaderprogram.cpp.
Sets the attribute at location in the current context to value.
Definition at line 1673 of file qopenglshaderprogram.cpp.
Sets the attribute at location in the current context to value.
Definition at line 1698 of file qopenglshaderprogram.cpp.
Sets the attribute at location in the current context to value.
Definition at line 1536 of file qopenglshaderprogram.cpp.
Sets the attribute at location in the current context to the 2D vector (x, y).
Definition at line 1561 of file qopenglshaderprogram.cpp.
Sets the attribute at location in the current context to the 3D vector (x, y, z).
Definition at line 1589 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setAttributeValue | ( | int | location, |
GLfloat | x, | ||
GLfloat | y, | ||
GLfloat | z, | ||
GLfloat | w ) |
Sets the attribute at location in the current context to the 4D vector (x, y, z, w).
Definition at line 1620 of file qopenglshaderprogram.cpp.
Sets the default outer tessellation levels to be used by the tessellation primitive generator in the event that the tessellation control shader does not output them to levels.
For more details on OpenGL and Tessellation shaders see \l{OpenGL Tessellation Shaders}.
The levels argument should be a QList consisting of 2 floats. Not all of the values make sense for all tessellation modes. If you specify a vector with fewer than 2 elements, the remaining elements will be given a default value of 1.
Definition at line 3629 of file qopenglshaderprogram.cpp.
Sets the default outer tessellation levels to be used by the tessellation primitive generator in the event that the tessellation control shader does not output them to levels.
For more details on OpenGL and Tessellation shaders see \l{OpenGL Tessellation Shaders}.
The levels argument should be a QList consisting of 4 floats. Not all of the values make sense for all tessellation modes. If you specify a vector with fewer than 4 elements, the remaining elements will be given a default value of 1.
Definition at line 3556 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setPatchVertexCount | ( | int | count | ) |
Use this function to specify to OpenGL the number of vertices in a patch to count.
A patch is a custom OpenGL primitive whose interpretation is entirely defined by the tessellation shader stages. Therefore, calling this function only makes sense when using a QOpenGLShaderProgram containing tessellation stage shaders. When using OpenGL tessellation, the only primitive that can be rendered with {glDraw*()} functions is
{GL_PATCHES}.
This is equivalent to calling glPatchParameteri(GL_PATCH_VERTICES, count).
Definition at line 3514 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 2x2 matrix value.
The matrix elements must be specified in column-major order.
Definition at line 2949 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x3 matrix value.
The matrix elements must be specified in column-major order.
Definition at line 2963 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 4x4 matrix value.
The matrix elements must be specified in column-major order.
Definition at line 2977 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to the red, green, blue, and alpha components of color.
Definition at line 2485 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QMatrix2x2 & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 2x2 matrix value.
Definition at line 2627 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QMatrix2x3 & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 2x3 matrix value.
Definition at line 2661 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QMatrix2x4 & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 2x4 matrix value.
Definition at line 2695 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QMatrix3x2 & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x2 matrix value.
Definition at line 2729 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QMatrix3x3 & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x3 matrix value.
Definition at line 2755 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QMatrix3x4 & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x4 matrix value.
Definition at line 2789 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QMatrix4x2 & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 4x2 matrix value.
Definition at line 2823 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QMatrix4x3 & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 4x3 matrix value.
Definition at line 2857 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QMatrix4x4 & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 4x4 matrix value.
Definition at line 2883 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable associated with name in the current context to the x and y coordinates of point.
Definition at line 2514 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable associated with name in the current context to the x and y coordinates of point.
Definition at line 2543 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable associated with name in the current context to the width and height of the given size.
Definition at line 2572 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable associated with name in the current context to the width and height of the given size.
Definition at line 2601 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
const QTransform & | value ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to a 3x3 transformation matrix value that is specified as a QTransform value.
To set a QTransform value as a 4x4 matrix in a shader, use {setUniformValue(name, QMatrix4x4(value))}.
Definition at line 3012 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value.
Definition at line 2403 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value.
Definition at line 2429 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value.
Definition at line 2455 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value.
Definition at line 2227 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to the 2D vector (x, y).
Definition at line 2315 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to the 3D vector (x, y, z).
Definition at line 2345 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | const char * | name, |
GLfloat | x, | ||
GLfloat | y, | ||
GLfloat | z, | ||
GLfloat | w ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to the 4D vector (x, y, z, w).
Definition at line 2376 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value.
Definition at line 2253 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable called name in the current context to value.
This function should be used when setting sampler values.
Definition at line 2286 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable at location in the current context to a 2x2 matrix value.
The matrix elements must be specified in column-major order.
Definition at line 2897 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable at location in the current context to a 3x3 matrix value.
The matrix elements must be specified in column-major order.
Definition at line 2914 of file qopenglshaderprogram.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable at location in the current context to a 4x4 matrix value.
The matrix elements must be specified in column-major order.
Definition at line 2931 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to the red, green, blue, and alpha components of color.
Definition at line 2466 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QMatrix2x2 & | value ) |
Sets the uniform variable at location in the current context to a 2x2 matrix value.
Definition at line 2612 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QMatrix2x3 & | value ) |
Sets the uniform variable at location in the current context to a 2x3 matrix value.
Definition at line 2642 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QMatrix2x4 & | value ) |
Sets the uniform variable at location in the current context to a 2x4 matrix value.
Definition at line 2676 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QMatrix3x2 & | value ) |
Sets the uniform variable at location in the current context to a 3x2 matrix value.
Definition at line 2710 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QMatrix3x3 & | value ) |
Sets the uniform variable at location in the current context to a 3x3 matrix value.
Definition at line 2740 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QMatrix3x4 & | value ) |
Sets the uniform variable at location in the current context to a 3x4 matrix value.
Definition at line 2770 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QMatrix4x2 & | value ) |
Sets the uniform variable at location in the current context to a 4x2 matrix value.
Definition at line 2804 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QMatrix4x3 & | value ) |
Sets the uniform variable at location in the current context to a 4x3 matrix value.
Definition at line 2838 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QMatrix4x4 & | value ) |
Sets the uniform variable at location in the current context to a 4x4 matrix value.
Definition at line 2868 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to the x and y coordinates of point.
Definition at line 2496 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to the x and y coordinates of point.
Definition at line 2525 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to the width and height of the given size.
Definition at line 2554 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to the width and height of the given size.
Definition at line 2583 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
const QTransform & | value ) |
Sets the uniform variable at location in the current context to a 3x3 transformation matrix value that is specified as a QTransform value.
To set a QTransform value as a 4x4 matrix in a shader, use {setUniformValue(location, QMatrix4x4(value))}.
Definition at line 2989 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to value.
Definition at line 2387 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to value.
Definition at line 2413 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to value.
Definition at line 2439 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to value.
Definition at line 2211 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to the 2D vector (x, y).
Definition at line 2297 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to the 3D vector (x, y, z).
Definition at line 2326 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValue | ( | int | location, |
GLfloat | x, | ||
GLfloat | y, | ||
GLfloat | z, | ||
GLfloat | w ) |
Sets the uniform variable at location in the current context to the 4D vector (x, y, z, w).
Definition at line 2357 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to value.
Definition at line 2237 of file qopenglshaderprogram.cpp.
Sets the uniform variable at location in the current context to value.
This function should be used when setting sampler values.
Definition at line 2267 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const GLfloat * | values, | ||
int | count, | ||
int | tupleSize ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count elements of values.
Each element has tupleSize components. The tupleSize must be 1, 2, 3, or 4.
Definition at line 3113 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const GLint * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count elements of values.
Definition at line 3040 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const GLuint * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count elements of values.
This overload should be used when setting an array of sampler values.
Definition at line 3073 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QMatrix2x2 * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 2x2 matrix elements of values.
Definition at line 3257 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QMatrix2x3 * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 2x3 matrix elements of values.
Definition at line 3285 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QMatrix2x4 * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 2x4 matrix elements of values.
Definition at line 3313 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QMatrix3x2 * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 3x2 matrix elements of values.
Definition at line 3341 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QMatrix3x3 * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 3x3 matrix elements of values.
Definition at line 3368 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QMatrix3x4 * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 3x4 matrix elements of values.
Definition at line 3396 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QMatrix4x2 * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 4x2 matrix elements of values.
Definition at line 3424 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QMatrix4x3 * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 4x3 matrix elements of values.
Definition at line 3452 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QMatrix4x4 * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 4x4 matrix elements of values.
Definition at line 3479 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QVector2D * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 2D vector elements of values.
Definition at line 3141 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QVector3D * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 3D vector elements of values.
Definition at line 3168 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | const char * | name, |
const QVector4D * | values, | ||
int | count ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the uniform variable array called name in the current context to the count 4D vector elements of values.
Definition at line 3195 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const GLfloat * | values, | ||
int | count, | ||
int | tupleSize ) |
Sets the uniform variable array at location in the current context to the count elements of values.
Each element has tupleSize components. The tupleSize must be 1, 2, 3, or 4.
Definition at line 3086 of file qopenglshaderprogram.cpp.
Sets the uniform variable array at location in the current context to the count elements of values.
Definition at line 3024 of file qopenglshaderprogram.cpp.
Sets the uniform variable array at location in the current context to the count elements of values.
This overload should be used when setting an array of sampler values.
Definition at line 3056 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QMatrix2x2 * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 2x2 matrix elements of values.
Definition at line 3241 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QMatrix2x3 * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 2x3 matrix elements of values.
Definition at line 3268 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QMatrix2x4 * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 2x4 matrix elements of values.
Definition at line 3296 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QMatrix3x2 * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 3x2 matrix elements of values.
Definition at line 3324 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QMatrix3x3 * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 3x3 matrix elements of values.
Definition at line 3352 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QMatrix3x4 * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 3x4 matrix elements of values.
Definition at line 3379 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QMatrix4x2 * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 4x2 matrix elements of values.
Definition at line 3407 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QMatrix4x3 * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 4x3 matrix elements of values.
Definition at line 3435 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QMatrix4x4 * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 4x4 matrix elements of values.
Definition at line 3463 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QVector2D * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 2D vector elements of values.
Definition at line 3125 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QVector3D * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 3D vector elements of values.
Definition at line 3152 of file qopenglshaderprogram.cpp.
void QOpenGLShaderProgram::setUniformValueArray | ( | int | location, |
const QVector4D * | values, | ||
int | count ) |
Sets the uniform variable array at location in the current context to the count 4D vector elements of values.
Definition at line 3179 of file qopenglshaderprogram.cpp.
QList< QOpenGLShader * > QOpenGLShaderProgram::shaders | ( | ) | const |
Returns a list of all shaders that have been added to this shader program using addShader().
Definition at line 1235 of file qopenglshaderprogram.cpp.
int QOpenGLShaderProgram::uniformLocation | ( | const char * | name | ) | const |
Returns the location of the uniform variable name within this shader program's parameter list.
Returns -1 if name is not a valid uniform variable for this shader program.
Definition at line 2166 of file qopenglshaderprogram.cpp.
int QOpenGLShaderProgram::uniformLocation | ( | const QByteArray & | name | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the location of the uniform variable name within this shader program's parameter list.
Returns -1 if name is not a valid uniform variable for this shader program.
Definition at line 2187 of file qopenglshaderprogram.cpp.
int QOpenGLShaderProgram::uniformLocation | ( | const QString & | name | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the location of the uniform variable name within this shader program's parameter list.
Returns -1 if name is not a valid uniform variable for this shader program.
Definition at line 2201 of file qopenglshaderprogram.cpp.