Table Of Contents

Previous topic

QGLShaderProgram

Next topic

QGLWidget

QGLShader

Inheritance diagram of QGLShader

Note

This class was introduced in Qt 4.6

Synopsis

Functions

Static functions

Detailed Description

The PySide.QtOpenGL.QGLShader class allows OpenGL shaders to be compiled.

This class supports shaders written in the OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language (GLSL/ES).

PySide.QtOpenGL.QGLShader and PySide.QtOpenGL.QGLShaderProgram shelter the programmer from the details of compiling and linking vertex and fragment shaders.

class PySide.QtOpenGL.QGLShader(type[, parent=None])
class PySide.QtOpenGL.QGLShader(type, context[, parent=None])
Parameters:
PySide.QtOpenGL.QGLShader.ShaderTypeBit

This enum specifies the type of PySide.QtOpenGL.QGLShader that is being created.

Constant Description
QGLShader.Vertex Vertex shader written in the OpenGL Shading Language (GLSL).
QGLShader.Fragment Fragment shader written in the OpenGL Shading Language (GLSL).
QGLShader.Geometry Geometry shaders written in the OpenGL Shading Language (GLSL), based on the GL_EXT_geometry_shader4 extension.
PySide.QtOpenGL.QGLShader.compileSourceCode(source)
Parameters:source – str
Return type:PySide.QtCore.bool

Sets the source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.

PySide.QtOpenGL.QGLShader.compileSourceCode(source)
Parameters:sourcePySide.QtCore.QByteArray
Return type:PySide.QtCore.bool

This is an overloaded function.

Sets the source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.

PySide.QtOpenGL.QGLShader.compileSourceCode(source)
Parameters:source – unicode
Return type:PySide.QtCore.bool

This is an overloaded function.

Sets the source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.

PySide.QtOpenGL.QGLShader.compileSourceFile(fileName)
Parameters:fileName – unicode
Return type:PySide.QtCore.bool

Sets the source code for this shader to the contents of fileName and compiles it. Returns true if the file could be opened and the source compiled, false otherwise.

static PySide.QtOpenGL.QGLShader.hasOpenGLShaders(type[, context=None])
Parameters:
Return type:

PySide.QtCore.bool

PySide.QtOpenGL.QGLShader.isCompiled()
Return type:PySide.QtCore.bool

Returns true if this shader has been compiled; false otherwise.

PySide.QtOpenGL.QGLShader.log()
Return type:unicode

Returns the errors and warnings that occurred during the last compile.

PySide.QtOpenGL.QGLShader.shaderId()
Return type:long

Returns the OpenGL identifier associated with this shader.

PySide.QtOpenGL.QGLShader.shaderType()
Return type:PySide.QtOpenGL.QGLShader.ShaderType

Returns the type of this shader.

PySide.QtOpenGL.QGLShader.sourceCode()
Return type:PySide.QtCore.QByteArray

Returns the source code for this shader.