I have seen this as well . I say 'THE WORD' :),
a fix for this would be welcome Gordon Product Manager 3d __________________________________________________________ Gordon Tomlinson Email : gtomlinson @ overwatch.textron.com __________________________________________________________ -----Original Message----- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris Denham Sent: Tuesday, May 05, 2009 1:00 PM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] swapBuffers warning when window minimized Bit of a late reply to this one, but just arrived at the same problem. For me, on Windows, I also get a slew of these warnings when I move the window off screen. So, might be a bit fiddly to try and prevent frame update in all situations that SwapBuffers retuns false. I wondered if we could address this issue by only reporting the error if GetLastError is also non zero. Works for me! The value returned by GetLastError is zero when SwapBuffers is called for a minimized or off screen window, so we could just add a check for this. Just say the word, and I'll post my modified GraphicsWindowWin32.cpp to the submissions list. ;-) Cheers. Chris. e.g. //------------- OSG- 2..8 ---------- void GraphicsWindowWin32::swapBuffersImplementation() { if (!_realized) return; if (!::SwapBuffers(_hdc)) { reportErrorForScreen("GraphicsWindowWin32::swapBuffersImplementation() - Unable to swap display buffers", _traits->screenNum, ::GetLastError()); } } //------------- Modification to remove redundant warnings ---------- void GraphicsWindowWin32::swapBuffersImplementation() { if (!_realized) return; if (!::SwapBuffers(_hdc) && ::GetLastError() != 0) { reportErrorForScreen("GraphicsWindowWin32::swapBuffersImplementation() - Unable to swap display buffers", _traits->screenNum, ::GetLastError()); } } > Robert Osfield > Tue, 01 Jul 2008 11:05:14 -0700 > Hi John, > > I have just checked on linux box and it works fine, so I presume it's > a windowing specific issue. What windowing setup are you using? > > If swap buffers is failing then it suggest the best thing that could > be done would be to detect the window iconise event and stop the frame > loop from executing till the window opens up again. This could > possible be something put into osgViewer itself, although there is > probably multiple ways one could handle it - for instance keep the > frame loop running but stop the rendering dispatch the problem > windows. > Robert. > On Tue, Jul 1, 2008 at 5:36 PM, Argentieri, John-P63223 > <[EMAIL PROTECTED]> wrote: > > All, > > > > When an osg application is minimized, osg complains about swapbuffers > > failing, on every frame. This output can be overwhelming. Can we fix > > this > > somehow? Is there some kind of verbosity level? Is that even a word? > > > > John _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org