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).
QGLShader
andQGLShaderProgram
shelter 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
QGLShader
object of the specifiedtype
and 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
QGLShader
object of the specifiedtype
and 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
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.
- 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
source
code for this shader and compiles it. Returnstrue
if 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
fileName
and compiles it. Returnstrue
if the file could be opened and the source compiled, false otherwise.See also
- static PySide2.QtOpenGL.QGLShader.hasOpenGLShaders(type[, context=None])¶
- Parameters:
type –
ShaderType
context –
PySide2.QtOpenGL.QGLContext
- Return type:
bool
Returns
true
if shader programs of typetype
are supported on this system; false otherwise.The
context
is used to resolve the GLSL extensions. Ifcontext
isNone
, thencurrentContext()
is used.
- PySide2.QtOpenGL.QGLShader.isCompiled()¶
- Return type:
bool
Returns
true
if 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.