QOpenGLShader ClassThe QOpenGLShader class allows OpenGL shaders to be compiled. More... #include <QOpenGLShader> Inherits: QObject. This class was introduced in Qt 5.0. Public Types
Public Functions
Static Public Members
Additional Inherited Members
Detailed DescriptionThe QOpenGLShader 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). QOpenGLShader and QOpenGLShaderProgram shelter the programmer from the details of compiling and linking vertex and fragment shaders. See also QOpenGLShaderProgram. Member Type Documentation
flags QOpenGLShader::ShaderType |
Constant | Value | Description |
---|---|---|
QOpenGLShader::Vertex | 0x0001 | Vertex shader written in the OpenGL Shading Language (GLSL). |
QOpenGLShader::Fragment | 0x0002 | Fragment shader written in the OpenGL Shading Language (GLSL). |
QOpenGLShader::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.
Constructs a new QOpenGLShader object of the specified type and attaches it to parent. If shader programs are not supported, QOpenGLShaderProgram::hasOpenGLShaderPrograms() will return false.
This constructor is normally followed by a call to compileSourceCode() or compileSourceFile().
The shader will be associated with the current QOpenGLContext.
See also compileSourceCode() and compileSourceFile().
Deletes this shader. If the shader has been attached to a QOpenGLShaderProgram object, then the actual shader will stay around until the QOpenGLShaderProgram is destroyed.
Sets the source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.
See also compileSourceFile().
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.
See also compileSourceFile().
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.
See also 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.
See also compileSourceCode().
Returns true if shader programs of type type are supported on this system; false otherwise.
The context is used to resolve the GLSL extensions. If context is null, then QOpenGLContext::currentContext() is used.
Returns true if this shader has been compiled; false otherwise.
See also compileSourceCode() and compileSourceFile().
Returns the errors and warnings that occurred during the last compile.
See also compileSourceCode() and compileSourceFile().
Returns the OpenGL identifier associated with this shader.
See also QOpenGLShaderProgram::programId().
Returns the type of this shader.
Returns the source code for this shader.
See also compileSourceCode().