diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-06-04 00:13:54 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-06-04 00:13:54 (GMT) |
commit | 7010a53cbd6bc6d9cc6d63e2170a7300ce2750d8 (patch) | |
tree | 323233749dd13a97bb01272d32e3cee1f4f57d44 /examples/opengl/hellogl_es2 | |
parent | 55148bf3c47546a93222c3e48a3e1bad062b5640 (diff) | |
download | Qt-7010a53cbd6bc6d9cc6d63e2170a7300ce2750d8.zip Qt-7010a53cbd6bc6d9cc6d63e2170a7300ce2750d8.tar.gz Qt-7010a53cbd6bc6d9cc6d63e2170a7300ce2750d8.tar.bz2 |
Improvements to shader API in response to API review
Task-number: QT-80
Reviewed-by: Ian Walters
Diffstat (limited to 'examples/opengl/hellogl_es2')
-rw-r--r-- | examples/opengl/hellogl_es2/glwidget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/opengl/hellogl_es2/glwidget.cpp b/examples/opengl/hellogl_es2/glwidget.cpp index ee50670..cb4a48d 100644 --- a/examples/opengl/hellogl_es2/glwidget.cpp +++ b/examples/opengl/hellogl_es2/glwidget.cpp @@ -190,7 +190,7 @@ void GLWidget::initializeGL () " color = clamp(color, 0.0, 1.0);\n" " gl_Position = matrix * vertex;\n" "}\n"; - vshader1->setSourceCode(vsrc1); + vshader1->compile(vsrc1); QGLShader *fshader1 = new QGLShader(QGLShader::FragmentShader, this); const char *fsrc1 = @@ -199,7 +199,7 @@ void GLWidget::initializeGL () "{\n" " gl_FragColor = color;\n" "}\n"; - fshader1->setSourceCode(fsrc1); + fshader1->compile(fsrc1); program1.addShader(vshader1); program1.addShader(fshader1); @@ -224,7 +224,7 @@ void GLWidget::initializeGL () " gl_Position = matrix * vertex;\n" " texc = texCoord;\n" "}\n"; - vshader2->setSourceCode(vsrc2); + vshader2->compile(vsrc2); QGLShader *fshader2 = new QGLShader(QGLShader::FragmentShader); const char *fsrc2 = @@ -237,7 +237,7 @@ void GLWidget::initializeGL () " color = color * 0.2 + color * 0.8 * angle;\n" " gl_FragColor = vec4(clamp(color, 0.0, 1.0), 1.0);\n" "}\n"; - fshader2->setSourceCode(fsrc2); + fshader2->compile(fsrc2); program2.addShader(vshader2); program2.addShader(fshader2); |