Kaydet (Commit) 194c6709 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

try to fix mouse interaction on windows

Change-Id: I8662b0c20dc719401eec3e3d2d852bb3e139a641
üst 4e3e1420
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
}; };
// pImpl Pattern to avoid linking against OpenGL libs when using the class without the context // 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: public:
OpenGLWindow(Window* pParent); OpenGLWindow(Window* pParent);
......
...@@ -14,16 +14,19 @@ ...@@ -14,16 +14,19 @@
class OpenGLWindowImpl class OpenGLWindowImpl
{ {
public: public:
OpenGLWindowImpl(SystemChildWindow* pWindow); OpenGLWindowImpl(Window* pWindow);
OpenGLContext* getContext(); OpenGLContext* getContext();
private: private:
OpenGLContext maContext; 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); pWindow->SetMouseTransparent(false);
maContext.show();
} }
OpenGLContext* OpenGLWindowImpl::getContext() OpenGLContext* OpenGLWindowImpl::getContext()
...@@ -32,7 +35,7 @@ OpenGLContext* OpenGLWindowImpl::getContext() ...@@ -32,7 +35,7 @@ OpenGLContext* OpenGLWindowImpl::getContext()
} }
OpenGLWindow::OpenGLWindow(Window* pParent): OpenGLWindow::OpenGLWindow(Window* pParent):
SystemChildWindow(pParent, 0), Window(pParent, 0),
mpImpl(new OpenGLWindowImpl(this)), mpImpl(new OpenGLWindowImpl(this)),
mpRenderer(NULL) mpRenderer(NULL)
{ {
...@@ -57,6 +60,7 @@ void OpenGLWindow::Paint(const Rectangle&) ...@@ -57,6 +60,7 @@ void OpenGLWindow::Paint(const Rectangle&)
void OpenGLWindow::MouseButtonDown( const MouseEvent& rMEvt ) void OpenGLWindow::MouseButtonDown( const MouseEvent& rMEvt )
{ {
getContext()->show();
maStartPoint = rMEvt.GetPosPixel(); maStartPoint = rMEvt.GetPosPixel();
} }
......
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