From b46d416987a4f62a3bcc6e4038e6b949c5b9af4b Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Thu, 16 Oct 2014 17:44:37 +0200 Subject: 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 --- .../tessellation-modes/TessellatedWireframeEffect.qml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'examples/tessellation-modes/TessellatedWireframeEffect.qml') diff --git a/examples/tessellation-modes/TessellatedWireframeEffect.qml b/examples/tessellation-modes/TessellatedWireframeEffect.qml index 7feaa66e9..731fe3917 100644 --- a/examples/tessellation-modes/TessellatedWireframeEffect.qml +++ b/examples/tessellation-modes/TessellatedWireframeEffect.qml @@ -54,11 +54,12 @@ Effect { // It's expected that users of this will specify the tessellation control and evaluation // shaders and if necessary suitable replacements for the other stages - property alias vertexShaderSourceFile: program.vertexShaderSourceFile - property alias tessellationControlShaderSourceFile: program.tessellationControlShaderSourceFile - property alias tessellationEvaluationShaderSourceFile: program.tessellationEvaluationShaderSourceFile - property alias geometryShaderSourceFile: program.geometryShaderSourceFile - property alias fragmentShaderSourceFile: program.fragmentShaderSourceFile + property alias vertexShaderCode: program.vertexShaderCode + property alias tessellationControlShaderCode: program.tessellationControlShaderCode + property alias tessellationEvaluationShaderCode: program.tessellationEvaluationShaderCode + property alias geometryShaderCode: program.geometryShaderCode + property alias fragmentShaderCode: program.fragmentShaderCode + property alias shaderProgram: program parameters: [ Parameter { name: "ambient"; value: Qt.vector3d( 0.1, 0.1, 0.1 ) }, @@ -101,9 +102,9 @@ Effect { shaderProgram: ShaderProgram { id: program - vertexShaderSourceFile: ":/shaders/passthru.vert" - geometryShaderSourceFile: ":/shaders/robustwireframe.geom" - fragmentShaderSourceFile: ":/shaders/phongwireframe.frag" + vertexShaderCode: loadSource("qrc:/shaders/passthru.vert") + geometryShaderCode: loadSource("qrc:/shaders/robustwireframe.geom") + fragmentShaderCode: loadSource("qrc:/shaders/phongwireframe.frag") } } ] -- cgit v1.2.3