Kaydet (Commit) 8325b7b4 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

prevent initializing the OpenGL context multiple times

Change-Id: I2ebdbcd51938bc1dc61693ac392eed5d5e497a8d
üst feffcbb0
......@@ -109,6 +109,7 @@ private:
GLWindow m_aGLWin;
boost::scoped_ptr<Window> m_pWindow;
boost::scoped_ptr<SystemChildWindow> m_pChildWindow;
bool mbInitialized;
};
#endif
......
......@@ -13,7 +13,8 @@
using namespace com::sun::star;
OpenGLContext::OpenGLContext()
OpenGLContext::OpenGLContext():
mbInitialized(false)
{
}
......@@ -319,6 +320,9 @@ int oglErrorHandler( Display* /*dpy*/, XErrorEvent* /*evnt*/ )
bool OpenGLContext::init( Window* pParent )
{
m_pWindow.reset(pParent ? pParent : new Window(0, WB_NOBORDER|WB_NODIALOGCONTROL));
if(mbInitialized)
return true;
SAL_INFO("vcl.opengl", "OpenGLContext::OpenGLContext----start");
initWindow();
m_pWindow->setPosSizePixel(0,0,0,0);
......@@ -441,6 +445,7 @@ bool OpenGLContext::init( Window* pParent )
#endif
SAL_INFO("vcl.opengl", "OpenGLContext::init----end");
mbInitialized = true;
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment