diff options
Diffstat (limited to 'examples/quick/scenegraph/graph/noisynode.cpp')
-rw-r--r-- | examples/quick/scenegraph/graph/noisynode.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/examples/quick/scenegraph/graph/noisynode.cpp b/examples/quick/scenegraph/graph/noisynode.cpp index 1fc87a2b97..7b2a843409 100644 --- a/examples/quick/scenegraph/graph/noisynode.cpp +++ b/examples/quick/scenegraph/graph/noisynode.cpp @@ -40,8 +40,6 @@ #include "noisynode.h" -#include <QtCore/QResource> - #include <QtQuick/QSGSimpleMaterialShader> #include <QtQuick/QSGTexture> #include <QtQuick/QQuickWindow> @@ -63,16 +61,9 @@ class NoisyShader : public QSGSimpleMaterialShader<NoisyMaterial> QSG_DECLARE_SIMPLE_SHADER(NoisyShader, NoisyMaterial) public: - const char *vertexShader() const { - QResource r(":/scenegraph/graph/shaders/noisy.vsh"); - Q_ASSERT(r.isValid()); - return (const char *) r.data(); - } - - const char *fragmentShader() const { - QResource r(":/scenegraph/graph/shaders/noisy.fsh"); - Q_ASSERT(r.isValid()); - return (const char *) r.data(); + NoisyShader() { + setShaderSourceFile(QOpenGLShader::Vertex, ":/scenegraph/graph/shaders/noisy.vsh"); + setShaderSourceFile(QOpenGLShader::Fragment, ":/scenegraph/graph/shaders/noisy.fsh"); } QList<QByteArray> attributes() const { return QList<QByteArray>() << "aVertex" << "aTexCoord"; } |