diff options
-rw-r--r-- | include/vcl/openglwin.hxx | 2 | ||||
-rw-r--r-- | vcl/source/window/openglwin.cxx | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/include/vcl/openglwin.hxx b/include/vcl/openglwin.hxx index 85d19408d198..50d564c177fa 100644 --- a/include/vcl/openglwin.hxx +++ b/include/vcl/openglwin.hxx @@ -32,7 +32,7 @@ public: }; // pImpl Pattern to avoid linking against OpenGL libs when using the class without the context -class VCLOPENGL_DLLPUBLIC OpenGLWindow : public SystemChildWindow +class VCLOPENGL_DLLPUBLIC OpenGLWindow : public Window { public: OpenGLWindow(Window* pParent); diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx index 19833763ecaf..68eac16dfa77 100644 --- a/vcl/source/window/openglwin.cxx +++ b/vcl/source/window/openglwin.cxx @@ -14,16 +14,19 @@ class OpenGLWindowImpl { public: - OpenGLWindowImpl(SystemChildWindow* pWindow); + OpenGLWindowImpl(Window* pWindow); OpenGLContext* getContext(); private: OpenGLContext maContext; + boost::scoped_ptr<SystemChildWindow> mpChildWindow; }; -OpenGLWindowImpl::OpenGLWindowImpl(SystemChildWindow* pWindow) +OpenGLWindowImpl::OpenGLWindowImpl(Window* pWindow): + mpChildWindow(new SystemChildWindow(pWindow)) { - maContext.init(pWindow); + maContext.init(mpChildWindow.get()); pWindow->SetMouseTransparent(false); + maContext.show(); } OpenGLContext* OpenGLWindowImpl::getContext() @@ -32,7 +35,7 @@ OpenGLContext* OpenGLWindowImpl::getContext() } OpenGLWindow::OpenGLWindow(Window* pParent): - SystemChildWindow(pParent, 0), + Window(pParent, 0), mpImpl(new OpenGLWindowImpl(this)), mpRenderer(NULL) { @@ -57,6 +60,7 @@ void OpenGLWindow::Paint(const Rectangle&) void OpenGLWindow::MouseButtonDown( const MouseEvent& rMEvt ) { + getContext()->show(); maStartPoint = rMEvt.GetPosPixel(); } |