summaryrefslogtreecommitdiffstats
path: root/src/render/frontend/qshaderprogram.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2014-10-16 17:44:37 +0200
committerSean Harmer <sean.harmer@kdab.com>2014-10-18 13:50:25 +0200
commitb46d416987a4f62a3bcc6e4038e6b949c5b9af4b (patch)
tree341874d8340051786bb1223de5d63c8f84ba7405 /src/render/frontend/qshaderprogram.h
parent16749ae5dbab2caa67d816a6778cdfd92e9510ac (diff)
QShaderProgram: remove source file properties, replace by helper method
Only the source code QByteArray properties remain. The user is still able to load a shader from a source file by using the shaderFromSource helper method and assigning what it returns to one of the QByteArray source code properties. Change-Id: I5246498fa680ec74d095d7a45f0b1bce239efc13 Task-number: QTBUG-41536 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend/qshaderprogram.h')
-rw-r--r--src/render/frontend/qshaderprogram.h38
1 files changed, 2 insertions, 36 deletions
diff --git a/src/render/frontend/qshaderprogram.h b/src/render/frontend/qshaderprogram.h
index 63f0398a0..7de2a89d6 100644
--- a/src/render/frontend/qshaderprogram.h
+++ b/src/render/frontend/qshaderprogram.h
@@ -55,13 +55,6 @@ class QShaderProgramPrivate;
class QT3DRENDERERSHARED_EXPORT QShaderProgram : public QNode
{
Q_OBJECT
-
- Q_PROPERTY(QString vertexShaderSourceFile READ vertexShaderSourceFile WRITE setVertexShaderSourceFile NOTIFY vertexShaderSourceFileChanged)
- Q_PROPERTY(QString tessellationControlShaderSourceFile READ tessellationControlShaderSourceFile WRITE setTessellationControlShaderSourceFile NOTIFY tessellationControlShaderSourceFileChanged)
- Q_PROPERTY(QString tessellationEvaluationShaderSourceFile READ tessellationEvaluationShaderSourceFile WRITE setTessellationEvaluationShaderSourceFile NOTIFY tessellationEvaluationShaderSourceFileChanged)
- Q_PROPERTY(QString geometryShaderSourceFile READ geometryShaderSourceFile WRITE setGeometryShaderSourceFile NOTIFY geometryShaderSourceFileChanged)
- Q_PROPERTY(QString fragmentShaderSourceFile READ fragmentShaderSourceFile WRITE setFragmentShaderSourceFile NOTIFY fragmentShaderSourceFileChanged)
- Q_PROPERTY(QString computeShaderSourceFile READ computeShaderSourceFile WRITE setComputeShaderSourceFile NOTIFY computeShaderSourceFileChanged)
Q_PROPERTY(QByteArray vertexShaderCode READ vertexShaderCode WRITE setVertexShaderCode NOTIFY vertexShaderCodeChanged)
Q_PROPERTY(QByteArray tessellationControlShaderCode READ tessellationControlShaderCode WRITE setTessellationControlShaderCode NOTIFY tessellationControlShaderCodeChanged)
Q_PROPERTY(QByteArray tessellationEvaluationShaderCode READ tessellationEvaluationShaderCode WRITE setTessellationEvaluationShaderCode NOTIFY tessellationEvaluationShaderCodeChanged)
@@ -82,28 +75,6 @@ public:
Compute
};
- // Source from file
- void setVertexShaderSourceFile(const QString &vertexShaderSourceFile);
- QString vertexShaderSourceFile() const;
-
- void setTessellationControlShaderSourceFile(const QString &tessellationControlShaderSourceFile);
- QString tessellationControlShaderSourceFile() const;
-
- void setTessellationEvaluationShaderSourceFile(const QString &tessellationEvaluationShaderSourceFile);
- QString tessellationEvaluationShaderSourceFile() const;
-
- void setGeometryShaderSourceFile(const QString &geometryShaderSourceFile);
- QString geometryShaderSourceFile() const;
-
- void setFragmentShaderSourceFile(const QString &fragmentShaderSourceFile);
- QString fragmentShaderSourceFile() const;
-
- void setComputeShaderSourceFile(const QString &computeShaderSourceFile);
- QString computeShaderSourceFile() const;
-
- void setShaderSourceFile(ShaderType type, const QString &sourceFile);
- QString shaderSourceFile(ShaderType type) const;
-
// Source code in-line
void setVertexShaderCode(const QByteArray &vertexShaderCode);
QByteArray vertexShaderCode() const;
@@ -126,14 +97,9 @@ public:
void setShaderCode(ShaderType type, const QByteArray &shaderCode);
QByteArray shaderCode(ShaderType type) const;
-Q_SIGNALS:
- void vertexShaderSourceFileChanged();
- void tessellationControlShaderSourceFileChanged();
- void tessellationEvaluationShaderSourceFileChanged();
- void geometryShaderSourceFileChanged();
- void fragmentShaderSourceFileChanged();
- void computeShaderSourceFileChanged();
+ Q_INVOKABLE static QByteArray loadSource(const QUrl &sourceUrl);
+Q_SIGNALS:
void vertexShaderCodeChanged();
void tessellationControlShaderCodeChanged();
void tessellationEvaluationShaderCodeChanged();