QGLShader Class

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

Header: #include <QGLShader>
qmake: QT += opengl
Since: Qt 4.6
Inherits: QObject

This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This class was introduced in Qt 4.6.

Public Types

enum ShaderTypeBit { Vertex, Fragment, Geometry }

Detailed Description

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.

Note: This class has been deprecated in favor of QOpenGLShader.

See also QGLShaderProgram.

Member Type Documentation

enum QGLShader::ShaderTypeBit

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

ConstantValueDescription
QGLShader::Vertex0x0001Vertex shader written in the OpenGL Shading Language (GLSL).
QGLShader::Fragment0x0002Fragment shader written in the OpenGL Shading Language (GLSL).
QGLShader::Geometry0x0004Geometry shaders written in the OpenGL Shading Language (GLSL), based on the GL_EXT_geometry_shader4 extension.