summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglshaderprogram.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-08-27 15:19:28 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-27 15:19:28 (GMT)
commit162892030766ffe8711888ea9e8d3a368c6a75b2 (patch)
treeddfda2e163fdce5d7ead7ac1fbd7aedb4bb06b79 /src/opengl/qglshaderprogram.h
parent0bc91ae61b07751f44210e1b772679c0a180c900 (diff)
parent26b8b6783afe2c1c9f27c935eb46c05229757af1 (diff)
downloadQt-162892030766ffe8711888ea9e8d3a368c6a75b2.zip
Qt-162892030766ffe8711888ea9e8d3a368c6a75b2.tar.gz
Qt-162892030766ffe8711888ea9e8d3a368c6a75b2.tar.bz2
Merge branch '4.6'
Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
Diffstat (limited to 'src/opengl/qglshaderprogram.h')
-rw-r--r--src/opengl/qglshaderprogram.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
index c5295eb..4f95ef3 100644
--- a/src/opengl/qglshaderprogram.h
+++ b/src/opengl/qglshaderprogram.h
@@ -63,19 +63,21 @@ 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);
- explicit QGLShader(const QString& fileName, QObject *parent = 0);
QGLShader(const QString& fileName, QGLShader::ShaderType type, QObject *parent = 0);
QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = 0);
- QGLShader(const QString& fileName, const QGLContext *context, QObject *parent = 0);
QGLShader(const QString& fileName, QGLShader::ShaderType type, const QGLContext *context, QObject *parent = 0);
virtual ~QGLShader();
@@ -106,6 +108,9 @@ private:
Q_DISABLE_COPY(QGLShader)
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QGLShader::ShaderType);
+
+
class QGLShaderProgramPrivate;
class Q_OPENGL_EXPORT QGLShaderProgram : public QObject
@@ -123,6 +128,7 @@ public:
bool addShader(QGLShader::ShaderType type, const char *source);
bool addShader(QGLShader::ShaderType type, const QByteArray& source);
bool addShader(QGLShader::ShaderType type, const QString& source);
+ bool addShaderFromFile(QGLShader::ShaderType type, const QString& fileName);
void removeAllShaders();