QOpenGLShader Class

The QOpenGLShader class allows OpenGL shaders to be compiled. More...

Header: #include <QOpenGLShader>
qmake: QT += gui
Since: Qt 5.0
Inherits: QObject

This class was introduced in Qt 5.0.

Public Types

enum ShaderTypeBit { Vertex, Fragment, Geometry, TessellationControl, TessellationEvaluation, Compute }

Detailed Description

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

enum QOpenGLShader::ShaderTypeBit

This enum specifies the type of QOpenGLShader that is being created.

ConstantValueDescription
QOpenGLShader::Vertex0x0001Vertex shader written in the OpenGL Shading Language (GLSL).
QOpenGLShader::Fragment0x0002Fragment shader written in the OpenGL Shading Language (GLSL).
QOpenGLShader::Geometry0x0004Geometry shaders written in the OpenGL Shading Language (GLSL) (requires OpenGL >= 3.2 or OpenGL ES >= 3.2).
QOpenGLShader::TessellationControl0x0008Tessellation control shaders written in the OpenGL shading language (GLSL) (requires OpenGL >= 4.0 or OpenGL ES >= 3.2).
QOpenGLShader::TessellationEvaluation0x0010Tessellation evaluation shaders written in the OpenGL shading language (GLSL) (requires OpenGL >= 4.0 or OpenGL ES >= 3.2).
QOpenGLShader::Compute0x0020Compute shaders written in the OpenGL shading language (GLSL) (requires OpenGL >= 4.3 or OpenGL ES >= 3.1).