From Peter Amstutz, "Here is a simple change to osgViewer::GraphicsWindowWin32 to add a flag to WindowData to specify that the graphics window should not install an event handler of its own, per this discussion thread:

http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg23734.html

The change is source compatible with current osg code and will not affect current users, it simply adds an additional parameter to the GraphicsWindowWin32::WindowData struct constructor and defaults to the current behavior.

Attached are the files "include/osgViewer/api/Win32/GraphicsWindowWin32" and "src/osgViewer/GraphicsWindowWin32.cpp" with my changes, based on svn revision 10045.  In addition, I have provided an svn patch file with the same changes for your convenience.

I have discussed the matter with my supervisor, and agreed that my company makes no copyright claim over this extremely trivial change (or to put it another way, we assign copyright to the open scene graph community.)"
This commit is contained in:
Robert Osfield
2009-04-22 11:12:03 +00:00
parent 9478fa7f02
commit b6182a1239
2 changed files with 15 additions and 9 deletions

View File

@@ -1242,14 +1242,19 @@ bool GraphicsWindowWin32::setWindow( HWND handle )
return false;
}
if (!registerWindowProcedure())
WindowData *windowData = _traits.get() ? dynamic_cast<WindowData*>(_traits->inheritedWindowData.get()) : 0;
if (!windowData || windowData->_installEventHandler)
{
::wglDeleteContext(_hglrc);
_hglrc = 0;
::ReleaseDC(_hwnd, _hdc);
_hdc = 0;
_hwnd = 0;
return false;
if (!registerWindowProcedure())
{
::wglDeleteContext(_hglrc);
_hglrc = 0;
::ReleaseDC(_hwnd, _hdc);
_hdc = 0;
_hwnd = 0;
return false;
}
}
Win32WindowingSystem::getInterface()->registerWindow(_hwnd, this);