diff options
Diffstat (limited to 'doc/src/snippets/code/src_opengl_qglshaderprogram.cpp')
-rw-r--r-- | doc/src/snippets/code/src_opengl_qglshaderprogram.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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] |