The QGLShader class allows OpenGL shaders to be compiled. 更多...
继承 QObject .
The 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).
QGLShader and QGLShaderProgram shelter the programmer from the details of compiling and linking vertex and fragment shaders.
This enum specifies the type of QGLShader that is being created.
| 常量 | 值 | 描述 |
|---|---|---|
| QGLShader.Vertex | 0x0001 | Vertex shader written in the OpenGL Shading Language (GLSL). |
| QGLShader.Fragment | 0x0002 | Fragment shader written in the OpenGL Shading Language (GLSL). |
| QGLShader.Geometry | 0x0004 | Geometry shaders written in the OpenGL Shading Language (GLSL), based on the GL_EXT_geometry_shader4 extension. |
The ShaderType type is a typedef for QFlags <ShaderTypeBit>. It stores an OR combination of ShaderTypeBit values.
parent argument, if not None, causes self to be owned by Qt instead of PyQt.
构造新 QGLShader object 的指定 type and attaches it to parent 。若 shader programs are not supported, QGLShaderProgram.hasOpenGLShaderPrograms () will return false.
This constructor is normally followed by a call to compileSourceCode () 或 compileSourceFile ().
The shader will be associated with the current QGLContext .
另请参阅 compileSourceCode () 和 compileSourceFile ().
parent argument, if not None, causes self to be owned by Qt instead of PyQt.
构造新 QGLShader object 的指定 type and attaches it to parent 。若 shader programs are not supported, then QGLShaderProgram.hasOpenGLShaderPrograms () will return false.
This constructor is normally followed by a call to compileSourceCode () 或 compileSourceFile ().
The shader will be associated with context .
另请参阅 compileSourceCode () 和 compileSourceFile ().
设置 source code for this shader and compiles it. Returns true if the source was successfully compiled, false 否则。
另请参阅 compileSourceFile ().
这是重载函数。
设置 source code for this shader and compiles it. Returns true if the source was successfully compiled, false 否则。
另请参阅 compileSourceFile ().
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.
另请参阅 compileSourceCode ().
Returns true if shader programs of type type are supported on this system; false otherwise.
context is used to resolve the GLSL extensions. If context is null, then QGLContext.currentContext () 被使用。
该函数在 Qt 4.7 引入。
Returns true if this shader has been compiled; false 否则。
另请参阅 compileSourceCode () 和 compileSourceFile ().
Returns the errors and warnings that occurred during the last compile.
另请参阅 compileSourceCode () 和 compileSourceFile ().
Returns the OpenGL identifier associated with this shader.
另请参阅 QGLShaderProgram.programId ().
Returns the type of this shader.
Returns the source code for this shader.
另请参阅 compileSourceCode ().