diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-04-08 15:05:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-23 12:23:09 +0200 |
commit | e950557e1133e8aac65a453597ab35400a5b9a10 (patch) | |
tree | 835e04f12a584274cec65efaa6071001247417ee /src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | |
parent | 8a28462c13907800caf44c16580e0b2a2ee99f69 (diff) |
Avoid direct GL calls in Quick
Change-Id: I9b8673fb3292c9d5ad2f9e8e63f56dc661699be6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index c9115f35fc..d6e2487a89 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -53,6 +53,7 @@ #include <QtGui/QGuiApplication> #include <QtGui/QOpenGLFramebufferObject> #include <QtGui/QOpenGLVertexArrayObject> +#include <QtGui/QOpenGLFunctions_1_0> #include <private/qquickprofiler_p.h> @@ -2195,8 +2196,11 @@ void Renderer::renderUnmergedBatch(const Batch *batch) if (g->drawingMode() == GL_LINE_STRIP || g->drawingMode() == GL_LINE_LOOP || g->drawingMode() == GL_LINES) glLineWidth(g->lineWidth()); #if !defined(QT_OPENGL_ES_2) - else if (!QOpenGLContext::currentContext()->isOpenGLES() && g->drawingMode() == GL_POINTS) - glPointSize(g->lineWidth()); + else if (!QOpenGLContext::currentContext()->isOpenGLES() && g->drawingMode() == GL_POINTS) { + QOpenGLFunctions_1_0 *gl1funcs = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_1_0>(); + gl1funcs->initializeOpenGLFunctions(); + gl1funcs->glPointSize(g->lineWidth()); + } #endif if (g->indexCount()) @@ -2227,11 +2231,7 @@ void Renderer::renderBatches() glClearColor(clearColor().redF(), clearColor().greenF(), clearColor().blueF(), clearColor().alphaF()); if (m_useDepthBuffer) { -#if defined(QT_OPENGL_ES) - glClearDepthf(1); -#else - glClearDepth(1); -#endif + glClearDepthf(1); // calls glClearDepth() under the hood for desktop OpenGL glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glDepthMask(true); |