Hi John,

A quick note to see that I have your changes and will review them once I'm
through a set of quite widespread changes to the OSG code base so it's
taking me a while to get through.  Once I've wrapped this up in the next
couple of days I'll get to your submission.

Cheers,
Robert.

On 8 October 2015 at 19:26, Glen A Johnson Jr. <[email protected]>
wrote:

> The issue was previously reported by user Rain in the call for testing of
> OSG 3.4.0.
>
> Cut and paste of previous email stream which describes the problem:
>
>
>
> *From:*
>
>
> * Glen A Johnson Jr. [mailto:[email protected]
> <[email protected]>] Sent: Tuesday, July 28, 2015 1:27 PMTo:
> 'OpenSceneGraph Users' <[email protected]
> <[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] <[email protected]>*
>
>
>
> *From:*
>
>
> * osg-users [mailto:[email protected]
> <[email protected]>] On Behalf Of RainSent:
> Tuesday, July 28, 2015 11:18 AMTo: [email protected]
> <[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?*
>
>
>
>
>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to