From aefeef36fdd536bfc8b1038e14d552db8c60c70d Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 2 Dec 2014 06:54:27 +0000 Subject: vcl: use resetToReInitialize to avoid context problems on Windows. It appears that we have to do this for VirtualDevices, where we have freed / re-allocated the underlying resource, or we fail to switch the current context, and render to the wrong place, before blatting a blank texture over the top of it. Change-Id: I0253f216ea7dc9786374dc83ca38f4f6295e3035 --- vcl/source/opengl/OpenGLContext.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vcl/source/opengl') diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 95b39401fb2c..41eae3ba61b0 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -621,6 +621,17 @@ bool OpenGLContext::init(SystemChildWindow* pChildWindow) return ImplInit(); } +#if defined( WNT ) +// FIXME share resetToReInitialize() across platforms... +void OpenGLContext::resetToReInitialize() +{ + if( !mbInitialized ) + return; + resetCurrent(); + mbInitialized = false; +} +#endif + #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID bool OpenGLContext::init(Display* dpy, Window win, int screen) { -- cgit