Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QGLShaderProgram Class

TheQGLShaderProgram class allowsOpenGL shader programs to be linked and used.More...

Header:#include <QGLShaderProgram>
Since: Qt 4.6
Inherits:QObject

Public Functions

QGLShaderProgram(QObject * parent = 0)
QGLShaderProgram(const QGLContext * context, QObject * parent = 0)
virtual~QGLShaderProgram()
booladdShader(QGLShader * shader)
booladdShaderFromSourceCode(QGLShader::ShaderType type, const char * source)
booladdShaderFromSourceCode(QGLShader::ShaderType type, const QByteArray & source)
booladdShaderFromSourceCode(QGLShader::ShaderType type, const QString & source)
booladdShaderFromSourceFile(QGLShader::ShaderType type, const QString & fileName)
intattributeLocation(const char * name) const
intattributeLocation(const QByteArray & name) const
intattributeLocation(const QString & name) const
boolbind()
voidbindAttributeLocation(const char * name, int location)
voidbindAttributeLocation(const QByteArray & name, int location)
voidbindAttributeLocation(const QString & name, int location)
voiddisableAttributeArray(int location)
voiddisableAttributeArray(const char * name)
voidenableAttributeArray(int location)
voidenableAttributeArray(const char * name)
GLenumgeometryInputType() const
GLenumgeometryOutputType() const
intgeometryOutputVertexCount() const
boolisLinked() const
virtual boollink()
QStringlog() const
intmaxGeometryOutputVertices() const
GLuintprogramId() const
voidrelease()
voidremoveAllShaders()
voidremoveShader(QGLShader * shader)
voidsetAttributeArray(int location, const GLfloat * values, int tupleSize, int stride = 0)
voidsetAttributeArray(int location, const QVector2D * values, int stride = 0)
voidsetAttributeArray(int location, const QVector3D * values, int stride = 0)
voidsetAttributeArray(int location, const QVector4D * values, int stride = 0)
voidsetAttributeArray(int location, GLenum type, const void * values, int tupleSize, int stride = 0)
voidsetAttributeArray(const char * name, const GLfloat * values, int tupleSize, int stride = 0)
voidsetAttributeArray(const char * name, const QVector2D * values, int stride = 0)
voidsetAttributeArray(const char * name, const QVector3D * values, int stride = 0)
voidsetAttributeArray(const char * name, const QVector4D * values, int stride = 0)
voidsetAttributeArray(const char * name, GLenum type, const void * values, int tupleSize, int stride = 0)
voidsetAttributeBuffer(int location, GLenum type, int offset, int tupleSize, int stride = 0)
voidsetAttributeBuffer(const char * name, GLenum type, int offset, int tupleSize, int stride = 0)
voidsetAttributeValue(int location, GLfloat value)
voidsetAttributeValue(int location, GLfloat x, GLfloat y)
voidsetAttributeValue(int location, GLfloat x, GLfloat y, GLfloat z)
voidsetAttributeValue(int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
voidsetAttributeValue(int location, const QVector2D & value)
voidsetAttributeValue(int location, const QVector3D & value)
voidsetAttributeValue(int location, const QVector4D & value)
voidsetAttributeValue(int location, const QColor & value)
voidsetAttributeValue(int location, const GLfloat * values, int columns, int rows)
voidsetAttributeValue(const char * name, GLfloat value)
voidsetAttributeValue(const char * name, GLfloat x, GLfloat y)
voidsetAttributeValue(const char * name, GLfloat x, GLfloat y, GLfloat z)
voidsetAttributeValue(const char * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
voidsetAttributeValue(const char * name, const QVector2D & value)
voidsetAttributeValue(const char * name, const QVector3D & value)
voidsetAttributeValue(const char * name, const QVector4D & value)
voidsetAttributeValue(const char * name, const QColor & value)
voidsetAttributeValue(const char * name, const GLfloat * values, int columns, int rows)
voidsetGeometryInputType(GLenum inputType)
voidsetGeometryOutputType(GLenum outputType)
voidsetGeometryOutputVertexCount(int count)
voidsetUniformValue(int location, GLfloat value)
voidsetUniformValue(const char * name, const QPointF & point)
voidsetUniformValue(const char * name, const QSize & size)
voidsetUniformValue(const char * name, const QSizeF & size)
voidsetUniformValue(const char * name, const QMatrix2x2 & value)
voidsetUniformValue(const char * name, const QMatrix2x3 & value)
voidsetUniformValue(const char * name, const QMatrix2x4 & value)
voidsetUniformValue(const char * name, const QMatrix3x2 & value)
voidsetUniformValue(const char * name, const QMatrix3x3 & value)
voidsetUniformValue(const char * name, const QMatrix3x4 & value)
voidsetUniformValue(const char * name, const QMatrix4x2 & value)
voidsetUniformValue(const char * name, const QMatrix4x3 & value)
voidsetUniformValue(const char * name, const QMatrix4x4 & value)
voidsetUniformValue(int location, const GLfloat[2][2] value)
voidsetUniformValue(int location, const GLfloat[3][3] value)
voidsetUniformValue(int location, const GLfloat[4][4] value)
voidsetUniformValue(const char * name, const GLfloat[2][2] value)
voidsetUniformValue(const char * name, const GLfloat[3][3] value)
voidsetUniformValue(const char * name, const GLfloat[4][4] value)
voidsetUniformValue(const char * name, const QTransform & value)
voidsetUniformValue(int location, GLint value)
voidsetUniformValue(int location, GLuint value)
voidsetUniformValue(int location, GLfloat x, GLfloat y)
voidsetUniformValue(int location, GLfloat x, GLfloat y, GLfloat z)
voidsetUniformValue(int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
voidsetUniformValue(int location, const QVector2D & value)
voidsetUniformValue(int location, const QVector3D & value)
voidsetUniformValue(int location, const QVector4D & value)
voidsetUniformValue(int location, const QColor & color)
voidsetUniformValue(int location, const QPoint & point)
voidsetUniformValue(int location, const QPointF & point)
voidsetUniformValue(int location, const QSize & size)
voidsetUniformValue(int location, const QSizeF & size)
voidsetUniformValue(int location, const QMatrix2x2 & value)
voidsetUniformValue(int location, const QMatrix2x3 & value)
voidsetUniformValue(int location, const QMatrix2x4 & value)
voidsetUniformValue(int location, const QMatrix3x2 & value)
voidsetUniformValue(int location, const QMatrix3x3 & value)
voidsetUniformValue(int location, const QMatrix3x4 & value)
voidsetUniformValue(int location, const QMatrix4x2 & value)
voidsetUniformValue(int location, const QMatrix4x3 & value)
voidsetUniformValue(int location, const QMatrix4x4 & value)
voidsetUniformValue(int location, const QTransform & value)
voidsetUniformValue(const char * name, GLfloat value)
voidsetUniformValue(const char * name, GLint value)
voidsetUniformValue(const char * name, GLuint value)
voidsetUniformValue(const char * name, GLfloat x, GLfloat y)
voidsetUniformValue(const char * name, GLfloat x, GLfloat y, GLfloat z)
voidsetUniformValue(const char * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
voidsetUniformValue(const char * name, const QVector2D & value)
voidsetUniformValue(const char * name, const QVector3D & value)
voidsetUniformValue(const char * name, const QVector4D & value)
voidsetUniformValue(const char * name, const QColor & color)
voidsetUniformValue(const char * name, const QPoint & point)
voidsetUniformValueArray(int location, const GLfloat * values, int count, int tupleSize)
voidsetUniformValueArray(int location, const GLint * values, int count)
voidsetUniformValueArray(int location, const GLuint * values, int count)
voidsetUniformValueArray(int location, const QVector2D * values, int count)
voidsetUniformValueArray(int location, const QVector3D * values, int count)
voidsetUniformValueArray(int location, const QVector4D * values, int count)
voidsetUniformValueArray(int location, const QMatrix2x2 * values, int count)
voidsetUniformValueArray(int location, const QMatrix2x3 * values, int count)
voidsetUniformValueArray(int location, const QMatrix2x4 * values, int count)
voidsetUniformValueArray(int location, const QMatrix3x2 * values, int count)
voidsetUniformValueArray(int location, const QMatrix3x3 * values, int count)
voidsetUniformValueArray(int location, const QMatrix3x4 * values, int count)
voidsetUniformValueArray(int location, const QMatrix4x2 * values, int count)
voidsetUniformValueArray(int location, const QMatrix4x3 * values, int count)
voidsetUniformValueArray(int location, const QMatrix4x4 * values, int count)
voidsetUniformValueArray(const char * name, const GLint * values, int count)
voidsetUniformValueArray(const char * name, const GLuint * values, int count)
voidsetUniformValueArray(const char * name, const GLfloat * values, int count, int tupleSize)
voidsetUniformValueArray(const char * name, const QVector2D * values, int count)
voidsetUniformValueArray(const char * name, const QVector3D * values, int count)
voidsetUniformValueArray(const char * name, const QVector4D * values, int count)
voidsetUniformValueArray(const char * name, const QMatrix2x2 * values, int count)
voidsetUniformValueArray(const char * name, const QMatrix2x3 * values, int count)
voidsetUniformValueArray(const char * name, const QMatrix2x4 * values, int count)
voidsetUniformValueArray(const char * name, const QMatrix3x2 * values, int count)
voidsetUniformValueArray(const char * name, const QMatrix3x3 * values, int count)
voidsetUniformValueArray(const char * name, const QMatrix3x4 * values, int count)
voidsetUniformValueArray(const char * name, const QMatrix4x2 * values, int count)
voidsetUniformValueArray(const char * name, const QMatrix4x3 * values, int count)
voidsetUniformValueArray(const char * name, const QMatrix4x4 * values, int count)
QList<QGLShader *>shaders() const
intuniformLocation(const char * name) const
intuniformLocation(const QByteArray & name) const
intuniformLocation(const QString & name) const
  • 29 public functions inherited fromQObject

Static Public Members

boolhasOpenGLShaderPrograms(const QGLContext * context = 0)
  • 7 static public members inherited fromQObject

Additional Inherited Members

  • 1 property inherited fromQObject
  • 1 public slot inherited fromQObject
  • 1 signal inherited fromQObject
  • 8 protected functions inherited fromQObject

Detailed Description

TheQGLShaderProgram class allowsOpenGL shader programs to be linked and used.

Introduction

This class supports shader programs written in theOpenGL Shading Language (GLSL) and in theOpenGL/ES Shading Language (GLSL/ES).

QGLShader andQGLShaderProgram shelter the programmer from the details of compiling and linking vertex and fragment shaders.

The following example creates a vertex shader program using the supplied sourcecode. Once compiled and linked, the shader program is activated in the currentQGLContext by callingQGLShaderProgram::bind():

QGLShader shader(QGLShader::Vertex);shader.compileSourceCode(code);QGLShaderProgram program(context);program.addShader(shader);program.link();program.bind();

Writing portable shaders

Shader programs can be difficult to reuse acrossOpenGL implementations because of varying levels of support for standard vertex attributes and uniform variables. In particular, GLSL/ES lacks all of the standard variables that are present on desktopOpenGL systems:gl_Vertex,gl_Normal,gl_Color, and so on. DesktopOpenGL lacks the variable qualifiershighp,mediump, andlowp.

TheQGLShaderProgram class makes the process of writing portable shaders easier by prefixing all shader programs with the following lines on desktopOpenGL:

#define highp#define mediump#define lowp

This makes it possible to run most GLSL/ES shader programs on desktop systems. The programmer should restrict themselves to just features that are present in GLSL/ES, and avoid standard variable names that only work on the desktop.

Simple shader example

program.addShaderFromSourceCode(QGLShader::Vertex,"attribute highp vec4 vertex;\n""uniform highp mat4 matrix;\n""void main(void)\n""{\n""   gl_Position = matrix * vertex;\n""}");program.addShaderFromSourceCode(QGLShader::Fragment,"uniform mediump vec4 color;\n""void main(void)\n""{\n""   gl_FragColor = color;\n""}");program.link();program.bind();int vertexLocation= program.attributeLocation("vertex");int matrixLocation= program.uniformLocation("matrix");int colorLocation= program.uniformLocation("color");

With the above shader program active, we can draw a green triangle as follows:

static GLfloatconst triangleVertices[]= {60.0f,10.0f,0.0f,110.0f,110.0f,0.0f,10.0f,110.0f,0.0f};QColor color(0,255,0,255);QMatrix4x4 pmvMatrix;pmvMatrix.ortho(rect());program.enableAttributeArray(vertexLocation);program.setAttributeArray(vertexLocation, triangleVertices,3);program.setUniformValue(matrixLocation, pmvMatrix);program.setUniformValue(colorLocation, color);glDrawArrays(GL_TRIANGLES,0,3);program.disableAttributeArray(vertexLocation);

Binary shaders and programs

Binary shaders may be specified usingglShaderBinary() on the return value fromQGLShader::shaderId(). TheQGLShader instance containing the binary can then be added to the shader program withaddShader() and linked in the usual fashion withlink().

Binary programs may be specified usingglProgramBinaryOES() on the return value fromprogramId(). Then the application should calllink(), which will notice that the program has already been specified and linked, allowing other operations to be performed on the shader program.

See alsoQGLShader.

Member Function Documentation

QGLShaderProgram::QGLShaderProgram(QObject * parent = 0)

Constructs a new shader program and attaches it toparent. The program will be invalid untiladdShader() is called.

The shader program will be associated with the currentQGLContext.

See alsoaddShader().

QGLShaderProgram::QGLShaderProgram(constQGLContext * context,QObject * parent = 0)

Constructs a new shader program and attaches it toparent. The program will be invalid untiladdShader() is called.

The shader program will be associated withcontext.

See alsoaddShader().

[virtual]QGLShaderProgram::~QGLShaderProgram()

Deletes this shader program.

bool QGLShaderProgram::addShader(QGLShader * shader)

Adds a compiledshader to this shader program. Returns true if the shader could be added, or false otherwise.

Ownership of theshader object remains with the caller. It will not be deleted when thisQGLShaderProgram instance is deleted. This allows the caller to add the same shader to multiple shader programs.

See alsoaddShaderFromSourceCode(),addShaderFromSourceFile(),removeShader(),link(), andremoveAllShaders().

bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, constchar * source)

Compilessource as a shader of the specifiedtype and adds it to this shader program. Returns true if compilation was successful, false otherwise. The compilation errors and warnings will be made available vialog().

This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance ofQGLShader first.

See alsoaddShader(),addShaderFromSourceFile(),removeShader(),link(),log(), andremoveAllShaders().

bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, constQByteArray & source)

This is an overloaded function.

Compilessource as a shader of the specifiedtype and adds it to this shader program. Returns true if compilation was successful, false otherwise. The compilation errors and warnings will be made available vialog().

This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance ofQGLShader first.

See alsoaddShader(),addShaderFromSourceFile(),removeShader(),link(),log(), andremoveAllShaders().

bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, constQString & source)

This is an overloaded function.

Compilessource as a shader of the specifiedtype and adds it to this shader program. Returns true if compilation was successful, false otherwise. The compilation errors and warnings will be made available vialog().

This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance ofQGLShader first.

See alsoaddShader(),addShaderFromSourceFile(),removeShader(),link(),log(), andremoveAllShaders().

bool QGLShaderProgram::addShaderFromSourceFile(QGLShader::ShaderType type, constQString & fileName)

Compiles the contents offileName as a shader of the specifiedtype and adds it to this shader program. Returns true if compilation was successful, false otherwise. The compilation errors and warnings will be made available vialog().

This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance ofQGLShader first.

See alsoaddShader() andaddShaderFromSourceCode().

int QGLShaderProgram::attributeLocation(constchar * name) const

Returns the location of the attributename within this shader program's parameter list. Returns -1 ifname is not a valid attribute for this shader program.

See alsouniformLocation() andbindAttributeLocation().

int QGLShaderProgram::attributeLocation(constQByteArray & name) const

This is an overloaded function.

Returns the location of the attributename within this shader program's parameter list. Returns -1 ifname is not a valid attribute for this shader program.

See alsouniformLocation() andbindAttributeLocation().

int QGLShaderProgram::attributeLocation(constQString & name) const

This is an overloaded function.

Returns the location of the attributename within this shader program's parameter list. Returns -1 ifname is not a valid attribute for this shader program.

See alsouniformLocation() andbindAttributeLocation().

bool QGLShaderProgram::bind()

Binds this shader program to the activeQGLContext and makes it the current shader program. Any previously bound shader program is released. This is equivalent to callingglUseProgram() onprogramId(). 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 calllink().

See alsolink() andrelease().

void QGLShaderProgram::bindAttributeLocation(constchar * name,int location)

Binds the attributename to the specifiedlocation. 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.

See alsoattributeLocation().

void QGLShaderProgram::bindAttributeLocation(constQByteArray & name,int location)

This is an overloaded function.

Binds the attributename to the specifiedlocation. 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.

See alsoattributeLocation().

void QGLShaderProgram::bindAttributeLocation(constQString & name,int location)

This is an overloaded function.

Binds the attributename to the specifiedlocation. 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.

See alsoattributeLocation().

void QGLShaderProgram::disableAttributeArray(int location)

Disables the vertex array atlocation in this shader program that was enabled by a previous call toenableAttributeArray().

See alsoenableAttributeArray(),setAttributeArray(),setAttributeValue(), andsetUniformValue().

void QGLShaderProgram::disableAttributeArray(constchar * name)

This is an overloaded function.

Disables the vertex array calledname in this shader program that was enabled by a previous call toenableAttributeArray().

See alsoenableAttributeArray(),setAttributeArray(),setAttributeValue(), andsetUniformValue().

void QGLShaderProgram::enableAttributeArray(int location)

Enables the vertex array atlocation in this shader program so that the value set bysetAttributeArray() onlocation will be used by the shader program.

See alsodisableAttributeArray(),setAttributeArray(),setAttributeValue(), andsetUniformValue().

void QGLShaderProgram::enableAttributeArray(constchar * name)

This is an overloaded function.

Enables the vertex array calledname in this shader program so that the value set bysetAttributeArray() onname will be used by the shader program.

See alsodisableAttributeArray(),setAttributeArray(),setAttributeValue(), andsetUniformValue().

GLenum QGLShaderProgram::geometryInputType() const

Returns the geometry shader input type, if active.

This parameter takes effect the next time the program is linked.

This function was introduced in Qt 4.7.

See alsosetGeometryInputType().

GLenum QGLShaderProgram::geometryOutputType() const

Returns the geometry shader output type, if active.

This parameter takes effect the next time the program is linked.

This function was introduced in Qt 4.7.

See alsosetGeometryOutputType().

int QGLShaderProgram::geometryOutputVertexCount() const

Returns the maximum number of vertices the current geometry shader program will produce, if active.

This parameter takes effect the ntext time the program is linked.

This function was introduced in Qt 4.7.

See alsosetGeometryOutputVertexCount().

[static]bool QGLShaderProgram::hasOpenGLShaderPrograms(constQGLContext * context = 0)

Returns true if shader programs written in theOpenGL Shading Language (GLSL) are supported on this system; false otherwise.

Thecontext is used to resolve the GLSL extensions. Ifcontext is null, thenQGLContext::currentContext() is used.

bool QGLShaderProgram::isLinked() const

Returns true if this shader program has been linked; false otherwise.

See alsolink().

[virtual]bool QGLShaderProgram::link()

Links together the shaders that were added to this program withaddShader(). Returns true if the link was successful or false otherwise. If the link failed, the error messages can be retrieved withlog().

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.

See alsoaddShader() andlog().

QString QGLShaderProgram::log() const

Returns the errors and warnings that occurred during the lastlink() oraddShader() with explicitly specified source code.

See alsolink().

int QGLShaderProgram::maxGeometryOutputVertices() const

Returns the hardware limit for how many vertices a geometry shader can output.

This function was introduced in Qt 4.7.

See alsosetGeometryOutputVertexCount().

GLuint QGLShaderProgram::programId() const

Returns theOpenGL identifier associated with this shader program.

See alsoQGLShader::shaderId().

void QGLShaderProgram::release()

Releases the active shader program from the currentQGLContext. This is equivalent to callingglUseProgram(0).

See alsobind().

void QGLShaderProgram::removeAllShaders()

Removes all of the shaders that were added to this program previously. TheQGLShader objects for the shaders will not be deleted if they were constructed externally.QGLShader objects that are constructed internally byQGLShaderProgram will be deleted.

See alsoaddShader() andremoveShader().

void QGLShaderProgram::removeShader(QGLShader * shader)

Removesshader from this shader program. The object is not deleted.

See alsoaddShader(),link(), andremoveAllShaders().

void QGLShaderProgram::setAttributeArray(int location, constGLfloat * values,int tupleSize,int stride = 0)

Sets an array of vertexvalues on the attribute atlocation in this shader program. ThetupleSize indicates the number of components per vertex (1, 2, 3, or 4), and thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

The array will become active whenenableAttributeArray() is called on thelocation. Otherwise the value specified withsetAttributeValue() forlocation will be used.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(), anddisableAttributeArray().

void QGLShaderProgram::setAttributeArray(int location, constQVector2D * values,int stride = 0)

Sets an array of 2D vertexvalues on the attribute atlocation in this shader program. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

The array will become active whenenableAttributeArray() is called on thelocation. Otherwise the value specified withsetAttributeValue() forlocation will be used.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(), anddisableAttributeArray().

void QGLShaderProgram::setAttributeArray(int location, constQVector3D * values,int stride = 0)

Sets an array of 3D vertexvalues on the attribute atlocation in this shader program. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

The array will become active whenenableAttributeArray() is called on thelocation. Otherwise the value specified withsetAttributeValue() forlocation will be used.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(), anddisableAttributeArray().

void QGLShaderProgram::setAttributeArray(int location, constQVector4D * values,int stride = 0)

Sets an array of 4D vertexvalues on the attribute atlocation in this shader program. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

The array will become active whenenableAttributeArray() is called on thelocation. Otherwise the value specified withsetAttributeValue() forlocation will be used.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(), anddisableAttributeArray().

void QGLShaderProgram::setAttributeArray(int location,GLenum type, constvoid * values,int tupleSize,int stride = 0)

Sets an array of vertexvalues on the attribute atlocation in this shader program. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

Thetype indicates the type of elements in thevalues array, usuallyGL_FLOAT,GL_UNSIGNED_BYTE, etc. ThetupleSize indicates the number of components per vertex: 1, 2, 3, or 4.

The array will become active whenenableAttributeArray() is called on thelocation. Otherwise the value specified withsetAttributeValue() forlocation will be used.

ThesetAttributeBuffer() function can be used to set the attribute array to an offset within a vertex buffer.

This function was introduced in Qt 4.7.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(),disableAttributeArray(), andsetAttributeBuffer().

void QGLShaderProgram::setAttributeArray(constchar * name, constGLfloat * values,int tupleSize,int stride = 0)

This is an overloaded function.

Sets an array of vertexvalues on the attribute calledname in this shader program. ThetupleSize indicates the number of components per vertex (1, 2, 3, or 4), and thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

The array will become active whenenableAttributeArray() is called onname. Otherwise the value specified withsetAttributeValue() forname will be used.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(), anddisableAttributeArray().

void QGLShaderProgram::setAttributeArray(constchar * name, constQVector2D * values,int stride = 0)

This is an overloaded function.

Sets an array of 2D vertexvalues on the attribute calledname in this shader program. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

The array will become active whenenableAttributeArray() is called onname. Otherwise the value specified withsetAttributeValue() forname will be used.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(), anddisableAttributeArray().

void QGLShaderProgram::setAttributeArray(constchar * name, constQVector3D * values,int stride = 0)

This is an overloaded function.

Sets an array of 3D vertexvalues on the attribute calledname in this shader program. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

The array will become active whenenableAttributeArray() is called onname. Otherwise the value specified withsetAttributeValue() forname will be used.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(), anddisableAttributeArray().

void QGLShaderProgram::setAttributeArray(constchar * name, constQVector4D * values,int stride = 0)

This is an overloaded function.

Sets an array of 4D vertexvalues on the attribute calledname in this shader program. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

The array will become active whenenableAttributeArray() is called onname. Otherwise the value specified withsetAttributeValue() forname will be used.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(), anddisableAttributeArray().

void QGLShaderProgram::setAttributeArray(constchar * name,GLenum type, constvoid * values,int tupleSize,int stride = 0)

This is an overloaded function.

Sets an array of vertexvalues on the attribute calledname in this shader program. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed invalues.

Thetype indicates the type of elements in thevalues array, usuallyGL_FLOAT,GL_UNSIGNED_BYTE, etc. ThetupleSize indicates the number of components per vertex: 1, 2, 3, or 4.

The array will become active whenenableAttributeArray() is called on thename. Otherwise the value specified withsetAttributeValue() forname will be used.

ThesetAttributeBuffer() function can be used to set the attribute array to an offset within a vertex buffer.

This function was introduced in Qt 4.7.

See alsosetAttributeValue(),setUniformValue(),enableAttributeArray(),disableAttributeArray(), andsetAttributeBuffer().

void QGLShaderProgram::setAttributeBuffer(int location,GLenum type,int offset,int tupleSize,int stride = 0)

Sets an array of vertex values on the attribute atlocation in this shader program, starting at a specificoffset in the currently bound vertex buffer. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed in the value array.

Thetype indicates the type of elements in the vertex value array, usuallyGL_FLOAT,GL_UNSIGNED_BYTE, etc. ThetupleSize indicates the number of components per vertex: 1, 2, 3, or 4.

The array will become active whenenableAttributeArray() is called on thelocation. Otherwise the value specified withsetAttributeValue() forlocation will be used.

This function was introduced in Qt 4.7.

See alsosetAttributeArray().

void QGLShaderProgram::setAttributeBuffer(constchar * name,GLenum type,int offset,int tupleSize,int stride = 0)

This is an overloaded function.

Sets an array of vertex values on the attribute calledname in this shader program, starting at a specificoffset in the currently bound vertex buffer. Thestride indicates the number of bytes between vertices. A defaultstride value of zero indicates that the vertices are densely packed in the value array.

Thetype indicates the type of elements in the vertex value array, usuallyGL_FLOAT,GL_UNSIGNED_BYTE, etc. ThetupleSize indicates the number of components per vertex: 1, 2, 3, or 4.

The array will become active whenenableAttributeArray() is called on thename. Otherwise the value specified withsetAttributeValue() forname will be used.

This function was introduced in Qt 4.7.

See alsosetAttributeArray().

void QGLShaderProgram::setAttributeValue(int location,GLfloat value)

Sets the attribute atlocation in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(int location,GLfloat x,GLfloat y)

Sets the attribute atlocation in the current context to the 2D vector (x,y).

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(int location,GLfloat x,GLfloat y,GLfloat z)

Sets the attribute atlocation in the current context to the 3D vector (x,y,z).

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(int location,GLfloat x,GLfloat y,GLfloat z,GLfloat w)

Sets the attribute atlocation in the current context to the 4D vector (x,y,z,w).

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(int location, constQVector2D & value)

Sets the attribute atlocation in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(int location, constQVector3D & value)

Sets the attribute atlocation in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(int location, constQVector4D & value)

Sets the attribute atlocation in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(int location, constQColor & value)

Sets the attribute atlocation in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(int location, constGLfloat * values,int columns,int rows)

Sets the attribute atlocation in the current context to the contents ofvalues, which containscolumns elements, each consisting ofrows elements. Therows value should be 1, 2, 3, or 4. This function is typically used to set matrix values and column vectors.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(constchar * name,GLfloat value)

This is an overloaded function.

Sets the attribute calledname in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(constchar * name,GLfloat x,GLfloat y)

This is an overloaded function.

Sets the attribute calledname in the current context to the 2D vector (x,y).

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(constchar * name,GLfloat x,GLfloat y,GLfloat z)

This is an overloaded function.

Sets the attribute calledname in the current context to the 3D vector (x,y,z).

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(constchar * name,GLfloat x,GLfloat y,GLfloat z,GLfloat w)

This is an overloaded function.

Sets the attribute calledname in the current context to the 4D vector (x,y,z,w).

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(constchar * name, constQVector2D & value)

This is an overloaded function.

Sets the attribute calledname in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(constchar * name, constQVector3D & value)

This is an overloaded function.

Sets the attribute calledname in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(constchar * name, constQVector4D & value)

This is an overloaded function.

Sets the attribute calledname in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(constchar * name, constQColor & value)

This is an overloaded function.

Sets the attribute calledname in the current context tovalue.

See alsosetUniformValue().

void QGLShaderProgram::setAttributeValue(constchar * name, constGLfloat * values,int columns,int rows)

This is an overloaded function.

Sets the attribute calledname in the current context to the contents ofvalues, which containscolumns elements, each consisting ofrows elements. Therows value should be 1, 2, 3, or 4. This function is typically used to set matrix values and column vectors.

See alsosetUniformValue().

void QGLShaderProgram::setGeometryInputType(GLenum inputType)

Sets the input type frominputType.

This parameter takes effect the next time the program is linked.

See alsogeometryInputType().

void QGLShaderProgram::setGeometryOutputType(GLenum outputType)

Sets the output type from the geometry shader, if active, tooutputType.

This parameter takes effect the next time the program is linked.

This function was introduced in Qt 4.7.

See alsogeometryOutputType().

void QGLShaderProgram::setGeometryOutputVertexCount(int count)

Sets the maximum number of vertices the current geometry shader program will produce, if active, tocount.

This parameter takes effect the next time the program is linked.

This function was introduced in Qt 4.7.

See alsogeometryOutputVertexCount().

void QGLShaderProgram::setUniformValue(int location,GLfloat value)

Sets the uniform variable atlocation in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQPointF & point)

This is an overloaded function.

Sets the uniform variable associated withname in the current context to the x and y coordinates ofpoint.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQSize & size)

This is an overloaded function.

Sets the uniform variable associated withname in the current context to the width and height of the givensize.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQSizeF & size)

This is an overloaded function.

Sets the uniform variable associated withname in the current context to the width and height of the givensize.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQMatrix2x2 & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 2x2 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQMatrix2x3 & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 2x3 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQMatrix2x4 & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 2x4 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQMatrix3x2 & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 3x2 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQMatrix3x3 & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 3x3 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQMatrix3x4 & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 3x4 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQMatrix4x2 & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 4x2 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQMatrix4x3 & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 4x3 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQMatrix4x4 & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 4x4 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constGLfloat[2][2] value)

This is an overloaded function.

Sets the uniform variable atlocation in the current context to a 2x2 matrixvalue. The matrix elements must be specified in column-major order.

This function was introduced in Qt 4.7.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constGLfloat[3][3] value)

This is an overloaded function.

Sets the uniform variable atlocation in the current context to a 3x3 matrixvalue. The matrix elements must be specified in column-major order.

This function was introduced in Qt 4.7.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constGLfloat[4][4] value)

This is an overloaded function.

Sets the uniform variable atlocation in the current context to a 4x4 matrixvalue. The matrix elements must be specified in column-major order.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constGLfloat[2][2] value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 2x2 matrixvalue. The matrix elements must be specified in column-major order.

This function was introduced in Qt 4.7.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constGLfloat[3][3] value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 3x3 matrixvalue. The matrix elements must be specified in column-major order.

This function was introduced in Qt 4.7.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constGLfloat[4][4] value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 4x4 matrixvalue. The matrix elements must be specified in column-major order.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQTransform & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context to a 3x3 transformation matrixvalue that is specified as aQTransform value.

To set aQTransform value as a 4x4 matrix in a shader, usesetUniformValue(name, QMatrix4x4(value)).

void QGLShaderProgram::setUniformValue(int location,GLint value)

Sets the uniform variable atlocation in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location,GLuint value)

Sets the uniform variable atlocation in the current context tovalue. This function should be used when setting sampler values.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location,GLfloat x,GLfloat y)

Sets the uniform variable atlocation in the current context to the 2D vector (x,y).

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location,GLfloat x,GLfloat y,GLfloat z)

Sets the uniform variable atlocation in the current context to the 3D vector (x,y,z).

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location,GLfloat x,GLfloat y,GLfloat z,GLfloat w)

Sets the uniform variable atlocation in the current context to the 4D vector (x,y,z,w).

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQVector2D & value)

Sets the uniform variable atlocation in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQVector3D & value)

Sets the uniform variable atlocation in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQVector4D & value)

Sets the uniform variable atlocation in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQColor & color)

Sets the uniform variable atlocation in the current context to the red, green, blue, and alpha components ofcolor.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQPoint & point)

Sets the uniform variable atlocation in the current context to the x and y coordinates ofpoint.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQPointF & point)

Sets the uniform variable atlocation in the current context to the x and y coordinates ofpoint.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQSize & size)

Sets the uniform variable atlocation in the current context to the width and height of the givensize.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQSizeF & size)

Sets the uniform variable atlocation in the current context to the width and height of the givensize.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQMatrix2x2 & value)

Sets the uniform variable atlocation in the current context to a 2x2 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQMatrix2x3 & value)

Sets the uniform variable atlocation in the current context to a 2x3 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQMatrix2x4 & value)

Sets the uniform variable atlocation in the current context to a 2x4 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQMatrix3x2 & value)

Sets the uniform variable atlocation in the current context to a 3x2 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQMatrix3x3 & value)

Sets the uniform variable atlocation in the current context to a 3x3 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQMatrix3x4 & value)

Sets the uniform variable atlocation in the current context to a 3x4 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQMatrix4x2 & value)

Sets the uniform variable atlocation in the current context to a 4x2 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQMatrix4x3 & value)

Sets the uniform variable atlocation in the current context to a 4x3 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQMatrix4x4 & value)

Sets the uniform variable atlocation in the current context to a 4x4 matrixvalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(int location, constQTransform & value)

Sets the uniform variable atlocation in the current context to a 3x3 transformation matrixvalue that is specified as aQTransform value.

To set aQTransform value as a 4x4 matrix in a shader, usesetUniformValue(location, QMatrix4x4(value)).

void QGLShaderProgram::setUniformValue(constchar * name,GLfloat value)

This is an overloaded function.

Sets the uniform variable calledname in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name,GLint value)

This is an overloaded function.

Sets the uniform variable calledname in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name,GLuint value)

This is an overloaded function.

Sets the uniform variable calledname in the current context tovalue. This function should be used when setting sampler values.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name,GLfloat x,GLfloat y)

This is an overloaded function.

Sets the uniform variable calledname in the current context to the 2D vector (x,y).

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name,GLfloat x,GLfloat y,GLfloat z)

This is an overloaded function.

Sets the uniform variable calledname in the current context to the 3D vector (x,y,z).

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name,GLfloat x,GLfloat y,GLfloat z,GLfloat w)

This is an overloaded function.

Sets the uniform variable calledname in the current context to the 4D vector (x,y,z,w).

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQVector2D & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQVector3D & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQVector4D & value)

This is an overloaded function.

Sets the uniform variable calledname in the current context tovalue.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQColor & color)

This is an overloaded function.

Sets the uniform variable calledname in the current context to the red, green, blue, and alpha components ofcolor.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValue(constchar * name, constQPoint & point)

This is an overloaded function.

Sets the uniform variable associated withname in the current context to the x and y coordinates ofpoint.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constGLfloat * values,int count,int tupleSize)

Sets the uniform variable array atlocation in the current context to thecount elements ofvalues. Each element hastupleSize components. ThetupleSize must be 1, 2, 3, or 4.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constGLint * values,int count)

Sets the uniform variable array atlocation in the current context to thecount elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constGLuint * values,int count)

Sets the uniform variable array atlocation in the current context to thecount elements ofvalues. This overload should be used when setting an array of sampler values.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQVector2D * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 2D vector elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQVector3D * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 3D vector elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQVector4D * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 4D vector elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQMatrix2x2 * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 2x2 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQMatrix2x3 * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 2x3 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQMatrix2x4 * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 2x4 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQMatrix3x2 * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 3x2 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQMatrix3x3 * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 3x3 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQMatrix3x4 * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 3x4 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQMatrix4x2 * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 4x2 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQMatrix4x3 * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 4x3 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(int location, constQMatrix4x4 * values,int count)

Sets the uniform variable array atlocation in the current context to thecount 4x4 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constGLint * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constGLuint * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount elements ofvalues. This overload should be used when setting an array of sampler values.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constGLfloat * values,int count,int tupleSize)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount elements ofvalues. Each element hastupleSize components. ThetupleSize must be 1, 2, 3, or 4.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQVector2D * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 2D vector elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQVector3D * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 3D vector elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQVector4D * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 4D vector elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQMatrix2x2 * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 2x2 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQMatrix2x3 * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 2x3 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQMatrix2x4 * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 2x4 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQMatrix3x2 * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 3x2 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQMatrix3x3 * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 3x3 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQMatrix3x4 * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 3x4 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQMatrix4x2 * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 4x2 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQMatrix4x3 * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 4x3 matrix elements ofvalues.

See alsosetAttributeValue().

void QGLShaderProgram::setUniformValueArray(constchar * name, constQMatrix4x4 * values,int count)

This is an overloaded function.

Sets the uniform variable array calledname in the current context to thecount 4x4 matrix elements ofvalues.

See alsosetAttributeValue().

QList<QGLShader *> QGLShaderProgram::shaders() const

Returns a list of all shaders that have been added to this shader program usingaddShader().

See alsoaddShader() andremoveShader().

int QGLShaderProgram::uniformLocation(constchar * name) const

Returns the location of the uniform variablename within this shader program's parameter list. Returns -1 ifname is not a valid uniform variable for this shader program.

See alsoattributeLocation().

int QGLShaderProgram::uniformLocation(constQByteArray & name) const

This is an overloaded function.

Returns the location of the uniform variablename within this shader program's parameter list. Returns -1 ifname is not a valid uniform variable for this shader program.

See alsoattributeLocation().

int QGLShaderProgram::uniformLocation(constQString & name) const

This is an overloaded function.

Returns the location of the uniform variablename within this shader program's parameter list. Returns -1 ifname is not a valid uniform variable for this shader program.

See alsoattributeLocation().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp