diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-04-23 09:08:16 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-28 18:19:34 +0200 |
commit | 33d0a8d753883e6b33ba8610c52f7fee42d6d9f1 (patch) | |
tree | 8452d09194c35e0c3c94b7ccd6f16000af0b396b /tests/auto/opengl/qglfunctions | |
parent | 8f443ad0b96af1c3b07ca8faeba139091c7276a8 (diff) |
Remove direct OpenGL calls from QtOpenGL
Task-number: QTBUG-36483
Change-Id: I96dea5649c0a49a11cd2ff31da659cd2067e769d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto/opengl/qglfunctions')
-rw-r--r-- | tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp index cdd820cf5b..4e0375171a 100644 --- a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp +++ b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp @@ -62,7 +62,7 @@ bool tst_QGLFunctions::hasExtension(const char *name) { QString extensions = QString::fromLatin1 - (reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS))); + (reinterpret_cast<const char *>(QOpenGLContext::currentContext()->functions()->glGetString(GL_EXTENSIONS))); return extensions.split(QLatin1Char(' ')).contains (QString::fromLatin1(name)); } @@ -194,46 +194,46 @@ void tst_QGLFunctions::features() // Verify that the multitexture functions appear to resolve and work. void tst_QGLFunctions::multitexture() { - QGLFunctions funcs; + QOpenGLFunctions funcs; QGLWidget glw; if (!glw.isValid()) QSKIP("Could not create a GL context"); glw.makeCurrent(); - funcs.initializeGLFunctions(); + funcs.initializeOpenGLFunctions(); - if (!funcs.hasOpenGLFeature(QGLFunctions::Multitexture)) + if (!funcs.hasOpenGLFeature(QOpenGLFunctions::Multitexture)) QSKIP("Multitexture functions are not supported"); funcs.glActiveTexture(GL_TEXTURE1); GLint active = 0; - glGetIntegerv(GL_ACTIVE_TEXTURE, &active); + funcs.glGetIntegerv(GL_ACTIVE_TEXTURE, &active); QVERIFY(active == GL_TEXTURE1); funcs.glActiveTexture(GL_TEXTURE0); active = 0; - glGetIntegerv(GL_ACTIVE_TEXTURE, &active); + funcs.glGetIntegerv(GL_ACTIVE_TEXTURE, &active); QVERIFY(active == GL_TEXTURE0); } // Verify that the glBlendColor() function appears to resolve and work. void tst_QGLFunctions::blendColor() { - QGLFunctions funcs; + QOpenGLFunctions funcs; QGLWidget glw; if (!glw.isValid()) QSKIP("Could not create a GL context"); glw.makeCurrent(); - funcs.initializeGLFunctions(); + funcs.initializeOpenGLFunctions(); - if (!funcs.hasOpenGLFeature(QGLFunctions::BlendColor)) + if (!funcs.hasOpenGLFeature(QOpenGLFunctions::BlendColor)) QSKIP("glBlendColor() is not supported"); funcs.glBlendColor(0.0f, 1.0f, 0.0f, 1.0f); GLfloat colors[4] = {0.5f, 0.5f, 0.5f, 0.5f}; - glGetFloatv(GL_BLEND_COLOR, colors); + funcs.glGetFloatv(GL_BLEND_COLOR, colors); QCOMPARE(colors[0], 0.0f); QCOMPARE(colors[1], 1.0f); |