diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-08-26 06:54:04 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-08-27 03:39:49 (GMT) |
commit | c52061e7980fcde5d59a7657a254ce00d117b611 (patch) | |
tree | 6f6b3c82d116031949ef2567cf51cc8ad73ccc45 /src/opengl/qglshaderprogram.h | |
parent | 843b53d2e9471310c956950606737e867888b0a1 (diff) | |
download | Qt-c52061e7980fcde5d59a7657a254ce00d117b611.zip Qt-c52061e7980fcde5d59a7657a254ce00d117b611.tar.gz Qt-c52061e7980fcde5d59a7657a254ce00d117b611.tar.bz2 |
Make QGLShader::ShaderType slightly more future proof by
making it into a bitmask. I'll add GeometryShader in the future
Reviewed-by: Rhys Weatherley
Diffstat (limited to 'src/opengl/qglshaderprogram.h')
-rw-r--r-- | src/opengl/qglshaderprogram.h | 17 |
1 files changed, 12 insertions, 5 deletions
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 |