I submitted this with example images but got a reply that the message was to large.
I have removed the images and resubmitting. Glen Johnson Phone: 321-696-3122 Email: [email protected] From: Glen A Johnson Jr. [mailto:[email protected]] Sent: Tuesday, July 28, 2015 1:27 PM To: 'OpenSceneGraph Users' <[email protected]> Subject: RE: [osg-users] OSG 3.4.0 osgViewerMFC can not display model I've run into the same issue in my applications. I believe the issue is from a change in the osgViewer Library in GraphicsWindow32.cpp. In GraphicsWindowWin32::init() The following check has been added since the 3.2.1 version: int windowX = 0, windowY = 0, windowWidth = 0, windowHeight = 0; if (_traits.valid()) { windowX = _traits->x; windowY = _traits->y; windowWidth = _traits->width; windowHeight = _traits->height; } if (areWindowDimensionsChanged(_hwnd, _screenOriginX, _screenOriginY, windowX, windowY, windowWidth, windowHeight)) { resized(windowX, windowY, windowWidth, windowHeight); } In cases where the window has been created outside of osg and the window handle is added to the graphics context as in the osgViewerMFC application, the check in areWindowDimensionsChanged() will always be true since it is assuming that the window passed in via _traits is in the overall screenspace and not relative to the view. When resized() is called with the updated window the graphics window is offset from the previously created window. I believe if Rain moves his osgViewerMFC application window to the upper left corner of the screenspace he will see something like the view below where the view is offset from the intended window. <Image removed> ============================ I implemented the following change which corrects the issue for my applications as well as the osgViewerMFC in GraphicsWindow32.cpp. bool checkchange = false; int windowX = 0, windowY = 0, windowWidth = 0, windowHeight = 0; if (_traits.valid()) { checkchange = (_traits->x != 0) || (_traits->y != 0); if (checkchange) { windowX = _traits->x; windowY = _traits->y; windowWidth = _traits->width; windowHeight = _traits->height; } } else checkchange = true; if (checkchange) { if (areWindowDimensionsChanged(_hwnd, _screenOriginX, _screenOriginY, windowX, windowY, windowWidth, windowHeight)) { resized(windowX, windowY, windowWidth, windowHeight); } } I believe this preserves the intent of the added check which works correctly when the process uses GraphicsWindowWin32::createWindow() to create the graphics window. I have attached the modified GrahicsWindowWin32.cpp file for consideration. Glen Johnson Phone: 321-696-3122 Email: [email protected] <mailto:[email protected]> From: osg-users [mailto:[email protected]] On Behalf Of Rain Sent: Tuesday, July 28, 2015 11:18 AM To: [email protected] <mailto:[email protected]> Subject: [osg-users] OSG 3.4.0 osgViewerMFC can not display model Hi, I compiled OSG 3.4.0 rc7 using VC2010 on WIN7, but osgViewerMFC can not work like the old version, when I open a model, it can not display model, is it a bug? <Images Removed>
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

