summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglshaderprogram.h
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-08-27 00:54:14 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-08-27 00:54:14 (GMT)
commit741bbc1be204adb4ceb6f9ae2aa35772c63d989c (patch)
treecdb19c67a69613f3a3633a16e6213e37bc05978d /src/opengl/qglshaderprogram.h
parente201ff0ff3a8223b14a72954c898674e606f147e (diff)
downloadQt-741bbc1be204adb4ceb6f9ae2aa35772c63d989c.zip
Qt-741bbc1be204adb4ceb6f9ae2aa35772c63d989c.tar.gz
Qt-741bbc1be204adb4ceb6f9ae2aa35772c63d989c.tar.bz2
API improvements for creating shaders from files
It used to be possible to derive the shader type from the file extension, but this isn't very extensible and doesn't capture the usual extensions. Change it so that the shader type must be supplied explicitly. Also add the addShaderFromFile() function to QGLShaderProgram to provide a convenient short-cut for file-based shader creation. Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl/qglshaderprogram.h')
-rw-r--r--src/opengl/qglshaderprogram.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
index c5295eb..5499f8a 100644
--- a/src/opengl/qglshaderprogram.h
+++ b/src/opengl/qglshaderprogram.h
@@ -72,10 +72,8 @@ public:
};
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();
@@ -123,6 +121,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();