From: David Boddie Date: Tue, 19 Jul 2011 14:52:20 +0000 (+0200) Subject: Doc: Fixed shader program snippet. X-Git-Tag: qt-v5.0.0-alpha1~3468 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72aeb207c5ac8c0a8b60d0b5570df8bf9665c1c8;p=profile%2Fivi%2Fqtbase.git Doc: Fixed shader program snippet. Task-number: QTBUG-18982 Reviewed-by: Kim Motoyoshi Kalland (cherry picked from commit 41287c411cb4b1019d12a49ddf7a738174a42f25) Change-Id: I416411623037830abadbb3cf0a9d1d7aad6f1b96 Reviewed-on: http://codereview.qt-project.org/1987 Reviewed-by: Qt Sanity Bot Reviewed-by: Toby Tomkins Reviewed-by: Peter Yard --- diff --git a/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp b/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp index aa5225a..812adf9 100644 --- a/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp +++ b/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp @@ -52,7 +52,7 @@ program.bind(); //! [1] program.addShaderFromSourceCode(QGLShader::Vertex, "attribute highp vec4 vertex;\n" - "attribute mediump mat4 matrix;\n" + "uniform highp mat4 matrix;\n" "void main(void)\n" "{\n" " gl_Position = matrix * vertex;\n" @@ -67,7 +67,7 @@ program.link(); program.bind(); int vertexLocation = program.attributeLocation("vertex"); -int matrixLocation = program.attributeLocation("matrix"); +int matrixLocation = program.uniformLocation("matrix"); int colorLocation = program.uniformLocation("color"); //! [1]