<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:SimSun;
        mso-fareast-language:ZH-CN;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>I submitted this with example images but got a reply that the message was to large.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>I have removed the images and resubmitting.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Glen Johnson<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Phone: 321-696-3122<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Email: glenajohnsonjr@msn.com<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US'> Glen A Johnson Jr. [mailto:glenajohnsonjr@msn.com] <br><b>Sent:</b> Tuesday, July 28, 2015 1:27 PM<br><b>To:</b> 'OpenSceneGraph Users' <osg-users@lists.openscenegraph.org><br><b>Subject:</b> RE: [osg-users] OSG 3.4.0 osgViewerMFC can not display model<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>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.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>In GraphicsWindowWin32::init()<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>The following check has been added since the 3.2.1 version:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    int windowX = 0, windowY = 0, windowWidth = 0, windowHeight = 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    if (_traits.valid())<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        windowX = _traits->x;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        windowY = _traits->y;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        windowWidth = _traits->width;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        windowHeight = _traits->height;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    if (areWindowDimensionsChanged(_hwnd, _screenOriginX, _screenOriginY, windowX, windowY, windowWidth, windowHeight))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>        resized(windowX, windowY, windowWidth, windowHeight);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Courier New";mso-fareast-language:EN-US'>    }<o:p></o:p></span></p><div style='mso-element:para-border-div;border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 1.0pt 0in'><p class=MsoNormal style='border:none;padding:0in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>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. <o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><Image removed><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>============================</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>I implemented the following change which corrects the issue for my applications as well as the osgViewerMFC in GraphicsWindow32.cpp.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:EN-US'>bool</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'> checkchange = </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:EN-US'>false</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:EN-US'>int</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'> windowX = 0, windowY = 0, windowWidth = 0, windowHeight = 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:EN-US'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'> (_traits.valid())<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>       {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>              checkchange = (_traits->x != 0) || (_traits->y != 0);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>              </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:EN-US'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'> (checkchange)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>              {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>                     windowX = _traits->x;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>                     windowY = _traits->y;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>                     windowWidth = _traits->width;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>                     windowHeight = _traits->height;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>              }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>       }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:EN-US'>else</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>              checkchange = </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:EN-US'>true</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>       </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:EN-US'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'> (checkchange)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>       {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>              </span><span style='font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white;mso-fareast-language:EN-US'>if</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'> (areWindowDimensionsChanged(_hwnd, _screenOriginX, _screenOriginY, windowX, windowY, windowWidth, windowHeight))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>              {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>                     resized(windowX, windowY, windowWidth, windowHeight);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>              }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>       }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>I believe this preserves the intent of the added check which works correctly when the process uses </span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF;background:white;mso-highlight:white;mso-fareast-language:EN-US'>GraphicsWindowWin32</span><span style='font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white;mso-fareast-language:EN-US'>::createWindow()</span><span style='font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:EN-US'> </span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>to create the graphics window.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>I have attached the modified GrahicsWindowWin32.cpp file for consideration. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Glen Johnson<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Phone: 321-696-3122<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Email: <a href="mailto:glenajohnsonjr@msn.com">glenajohnsonjr@msn.com</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> osg-users [<a href="mailto:osg-users-bounces@lists.openscenegraph.org">mailto:osg-users-bounces@lists.openscenegraph.org</a>] <b>On Behalf Of </b>Rain<br><b>Sent:</b> Tuesday, July 28, 2015 11:18 AM<br><b>To:</b> <a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br><b>Subject:</b> [osg-users] OSG 3.4.0 osgViewerMFC can not display model<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:black'>Hi,<o:p></o:p></span></p></div><div><div style='mso-element:para-border-div;border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 1.0pt 0in'><p class=MsoNormal style='border:none;padding:0in'><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:black'>  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?<o:p></o:p></span></p></div></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:#1F497D'><Images Removed></span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:black'><o:p> </o:p></span></p></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p></div></body></html>