summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qglshaderprogram.cpp9
-rw-r--r--src/opengl/qglshaderprogram.h17
2 files changed, 18 insertions, 8 deletions
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 83578b3..8ce50cf 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -104,7 +104,7 @@ QT_BEGIN_NAMESPACE
on desktop systems. The programmer should restrict themselves
to just features that are present in GLSL/ES, and avoid
standard variable names that only work on the desktop.
-
+
\section1 Simple shader example
\code
@@ -199,8 +199,11 @@ QT_BEGIN_NAMESPACE
\value VertexShader Vertex shader written in the OpenGL Shading Language (GLSL).
\value FragmentShader Fragment shader written in the OpenGL Shading Language (GLSL).
+
\value PartialVertexShader Partial vertex shader that will be concatenated with all other partial vertex shaders at link time.
\value PartialFragmentShader Partial fragment shader that will be concatenated with all other partial fragment shaders at link time.
+
+ \omitvalue PartialShader
*/
#ifndef GL_FRAGMENT_SHADER
@@ -251,8 +254,7 @@ public:
, shader(0)
, shaderType(type)
, compiled(false)
- , isPartial(type == QGLShader::PartialVertexShader ||
- type == QGLShader::PartialFragmentShader)
+ , isPartial((type & QGLShader::PartialShader) != 0)
, hasPartialSource(false)
{
}
@@ -2960,6 +2962,7 @@ bool QGLShaderProgram::hasShaderPrograms(const QGLContext *context)
#endif
}
+
#endif
QT_END_NAMESPACE
diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
index 5499f8a..4f95ef3 100644
--- a/src/opengl/qglshaderprogram.h
+++ b/src/opengl/qglshaderprogram.h
@@ -63,13 +63,17 @@ class Q_OPENGL_EXPORT QGLShader : public QObject
{
Q_OBJECT
public:
- enum ShaderType
+ enum ShaderTypeBits
{
- VertexShader,
- FragmentShader,
- PartialVertexShader,
- PartialFragmentShader
+ VertexShader = 0x0001,
+ FragmentShader = 0x0002,
+
+ PartialShader = 0x1000,
+
+ PartialVertexShader = PartialShader | VertexShader,
+ PartialFragmentShader = PartialShader | FragmentShader
};
+ Q_DECLARE_FLAGS(ShaderType, ShaderTypeBits);
explicit QGLShader(QGLShader::ShaderType type, QObject *parent = 0);
QGLShader(const QString& fileName, QGLShader::ShaderType type, QObject *parent = 0);
@@ -104,6 +108,9 @@ private:
Q_DISABLE_COPY(QGLShader)
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QGLShader::ShaderType);
+
+
class QGLShaderProgramPrivate;
class Q_OPENGL_EXPORT QGLShaderProgram : public QObject