QGLShader¶

New in version 4.6.
Synopsis¶
Functions¶
def
compileSourceCode(source)def
compileSourceCode(source)def
compileSourceCode(source)def
compileSourceFile(fileName)def
isCompiled()def
log()def
shaderId()def
shaderType()def
sourceCode()
Static functions¶
def
hasOpenGLShaders(type[, context=None])
Detailed Description¶
This class supports shaders written in the OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language (GLSL/ES).
QGLShaderandQGLShaderProgramshelter the programmer from the details of compiling and linking vertex and fragment shaders.Note
This class has been deprecated in favor of
QOpenGLShader.See also
- class PySide2.QtOpenGL.QGLShader(type[, parent=None])¶
PySide2.QtOpenGL.QGLShader(type, context[, parent=None])
- param type:
- param parent:
- param context:
Constructs a new
QGLShaderobject of the specifiedtypeand attaches it toparent. If shader programs are not supported,hasOpenGLShaderPrograms()will return false.This constructor is normally followed by a call to
compileSourceCode()orcompileSourceFile().The shader will be associated with the current
QGLContext.See also
Constructs a new
QGLShaderobject of the specifiedtypeand attaches it toparent. If shader programs are not supported, thenhasOpenGLShaderPrograms()will return false.This constructor is normally followed by a call to
compileSourceCode()orcompileSourceFile().The shader will be associated with
context.See also
- PySide2.QtOpenGL.QGLShader.ShaderTypeBit¶
This enum specifies the type of
QGLShaderthat 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.
- PySide2.QtOpenGL.QGLShader.compileSourceCode(source)¶
- Parameters:
source –
PySide2.QtCore.QByteArray- Return type:
bool
- PySide2.QtOpenGL.QGLShader.compileSourceCode(source)
- Parameters:
source – str
- Return type:
bool
- PySide2.QtOpenGL.QGLShader.compileSourceCode(source)
- Parameters:
source – str
- Return type:
bool
Sets the
sourcecode for this shader and compiles it. Returnstrueif the source was successfully compiled, false otherwise.See also
- PySide2.QtOpenGL.QGLShader.compileSourceFile(fileName)¶
- Parameters:
fileName – str
- Return type:
bool
Sets the source code for this shader to the contents of
fileNameand compiles it. Returnstrueif the file could be opened and the source compiled, false otherwise.See also
- static PySide2.QtOpenGL.QGLShader.hasOpenGLShaders(type[, context=None])¶
- Parameters:
type –
ShaderTypecontext –
PySide2.QtOpenGL.QGLContext
- Return type:
bool
Returns
trueif shader programs of typetypeare supported on this system; false otherwise.The
contextis used to resolve the GLSL extensions. IfcontextisNone, thencurrentContext()is used.
- PySide2.QtOpenGL.QGLShader.isCompiled()¶
- Return type:
bool
Returns
trueif this shader has been compiled; false otherwise.See also
- PySide2.QtOpenGL.QGLShader.log()¶
- Return type:
str
Returns the errors and warnings that occurred during the last compile.
See also
- PySide2.QtOpenGL.QGLShader.shaderId()¶
- Return type:
GLuint
Returns the OpenGL identifier associated with this shader.
See also
- PySide2.QtOpenGL.QGLShader.shaderType()¶
- Return type:
Returns the type of this shader.
- PySide2.QtOpenGL.QGLShader.sourceCode()¶
- Return type:
Returns the source code for this shader.
See also
© 2022 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 the GNU 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.