From 9d9a36f6af584a9ebe1ae8f500dea379dcd99907 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 28 Jun 2010 08:24:53 +0000 Subject: [PATCH] From Brad Christiansen, "The small change I have made (against this morning's trunk) enables subclasses to register and unregister windows via protected methods. I need this access as I have a subclass that handles some of the oddities of mixing a native OpenGL window with Java's windowing system. I doubt there will be much general benefit of the modification but it should also not be harmful in any way to others." --- include/osgViewer/api/Win32/GraphicsWindowWin32 | 3 +++ src/osgViewer/GraphicsWindowWin32.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/osgViewer/api/Win32/GraphicsWindowWin32 b/include/osgViewer/api/Win32/GraphicsWindowWin32 index 927c6a236..e359bd940 100644 --- a/include/osgViewer/api/Win32/GraphicsWindowWin32 +++ b/include/osgViewer/api/Win32/GraphicsWindowWin32 @@ -106,6 +106,9 @@ class OSGVIEWER_EXPORT GraphicsWindowWin32 : public osgViewer::GraphicsWindow, p protected: void init(); + + void registerWindow(); + void unregisterWindow(); bool registerWindowProcedure(); bool unregisterWindowProcedure(); diff --git a/src/osgViewer/GraphicsWindowWin32.cpp b/src/osgViewer/GraphicsWindowWin32.cpp index 0c2f19722..160c9fc89 100644 --- a/src/osgViewer/GraphicsWindowWin32.cpp +++ b/src/osgViewer/GraphicsWindowWin32.cpp @@ -1334,6 +1334,16 @@ void GraphicsWindowWin32::destroyWindow( bool deleteNativeWindow ) _destroying = false; } +void GraphicsWindowWin32::registerWindow() +{ + Win32WindowingSystem::getInterface()->registerWindow(_hwnd, this); +} + +void GraphicsWindowWin32::unregisterWindow() +{ + Win32WindowingSystem::getInterface()->unregisterWindow(_hwnd); +} + bool GraphicsWindowWin32::registerWindowProcedure() { ::SetLastError(0);