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 <qt_sanity_bot@ovi.com>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Peter Yard <peter.yard@nokia.com>
This commit is contained in:
David Boddie 2011-07-19 16:52:20 +02:00 committed by Qt by Nokia
parent ebd86ae7f1
commit 72aeb207c5

View File

@ -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]