summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-10 09:08:46 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-10 09:13:26 (GMT)
commitb300c3022d285deb3b3203aca0746580ba9f3d91 (patch)
tree84975e875de489fda6400ffdbd7bfa82050b91af /src/opengl/gl2paintengineex
parent2c232cdbce3eba095da26362b964f411a9d3ba80 (diff)
downloadQt-b300c3022d285deb3b3203aca0746580ba9f3d91.zip
Qt-b300c3022d285deb3b3203aca0746580ba9f3d91.tar.gz
Qt-b300c3022d285deb3b3203aca0746580ba9f3d91.tar.bz2
Fix crash in gl2 paint engine on Windows
wglGetProcAddress() on Windows requires a current context. Since there was none, the resolution of GL extensions would silently fail, the function pointers would be null and when we tried to use them later we would get a crash (e.g. in startup of PadNavigator.) I've added an assert to make the cause of the crash clearer, and a makeCurrent() to fix the crash. Reviewed-by: Tom
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index c87941b..f8095bf 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1328,7 +1328,9 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->mode = BrushDrawingMode;
#if !defined(QT_OPENGL_ES_2)
- qt_resolve_version_2_0_functions(d->ctx);
+ d->ctx->makeCurrent();
+ bool success = qt_resolve_version_2_0_functions(d->ctx);
+ Q_ASSERT(success);
#endif
d->shaderManager = new QGLEngineShaderManager(d->ctx);