Re: [osg-users] swapBuffers warning when window minimized

2009-05-07 Thread Robert Osfield
Thanks Chris,  changes now merged and submitted to svn/trunk and OSG-2.8 branch.

On Wed, May 6, 2009 at 10:04 AM, Chris Denham c.m.den...@gmail.com wrote:
 Please find attached, my small change to GraphicsWindowWin32 (based on
 osg 2.8.0).
 It gets rid of redundant warnings about SwapBuffers failing for
 Windows platform when updating a minimized or off screen windows.
 Chris.

 2009/5/5 Tomlinson, Gordon gtomlin...@overwatch.textron.com:
 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


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] swapBuffers warning when window minimized

2009-05-06 Thread Robert Osfield
Hi Roland,

On Wed, May 6, 2009 at 10:37 AM, Roland Smeenk roland.sme...@tno.nl wrote:
 could you post this fix as a seperate post on the submissions forum. That way 
 it will also be sent to the osg-submissions mailing list and end up at the 
 proper location.

Chris sent the post to both osg-users and osg-submissions :-)

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] swapBuffers warning when window minimized

2009-05-05 Thread Chris Denham

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.org


Re: [osg-users] swapBuffers warning when window minimized

2009-05-05 Thread Tomlinson, Gordon
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


[osg-users] swapBuffers warning when window minimized

2008-07-01 Thread Argentieri, John-P63223
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.org


Re: [osg-users] swapBuffers warning when window minimized

2008-07-01 Thread Robert Osfield
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.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org