One extra note for adventurous types:

SWAP_UNDEFINED option currently exits the osgviewer (at least on my NVidia). 
Its normal behaviour because NVidia driver does not support UNDEFINED option 
and matching PixelFormat cannot be found. So the viewer exits.

Wojtek



From: Wojciech Lewandowski 
Sent: Thursday, October 07, 2010 11:49 AM
To: OpenSceneGraph Users 
Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7


Hi Everyone,

Big Thanks to Farshid for the solution :-) 

Support for his workaround, to use Copy as a swap Method, was recently included 
in OSG trunk. 
SwapCopy is not active by default - people not using Aero should be still happy 
 with default SwapExchange. 

These who would like to activate the SwapCopy method can use environment 
variables or osgViewer command line arguments ( provided they use Viewer( 
ArgumentParser ) ctor ).

env var method:

    set OSG_SWAP_METHOD=COPY

command line method:

    osgviewer --swap-method COPY

Inside the code one can select swap method for a particular window via 
GraphicsContext::Traits  or for all windows by changing the default set in 
DisplaySettings. Traits default to method set in DisplaySettings. 
DisplaySettings use whats set by env var or  command line. If no option is 
given DEFAULT is used. I hope such solution is fairly complete and covers all 
possible use cases.

All 4 allowed swap method options are: 

SWAP_EXCHANGE  - flip back & front buffers
SWAP_COPY - copy contents of back  buffer into front buffer
SWAP_UNDEFINED - move contents of back  buffer into front buffer, leaving back 
buffer contents undefined 
SWAP_DEFAULT - let the driver select the method (in my observation NVidia 
drivers on Win7 defaults to EXCHANGE) 

Cheers,
Wojtek Lewandowski



From: Wojciech Lewandowski 
Sent: Monday, September 27, 2010 2:31 PM
To: OpenSceneGraph Users 
Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7


Hi, 

I have submitted code changes. Look at osg-submissions for details.

Wojtek Lewandowski


From: Wojciech Lewandowski 
Sent: Friday, September 24, 2010 9:44 PM
To: OpenSceneGraph Users 
Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7


Hi,

Exactly as Farshid Said I have modified PreparePixelFormatSpecification 
function in GraphicsWindowWin32.cpp to test the workaround. Interestingly 
PreparePixelFormatSpecification has a input allowSwapExchangeARB parameter as 
if someone had similar problem before. But this parameter is used when function 
is called but not influenced directly by GraphicContext::Traits. In my opinion 
the best option would be expose Swap method in the GraphicContext::Traits.

I may try to come up with a patch on monday.  Anyone to beat me on this ;-)  ?

Wojtek

From: Farshid Lashkari 
Sent: Friday, September 24, 2010 6:40 PM
To: OpenSceneGraph Users 
Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7


Hi Robert,


On Fri, Sep 24, 2010 at 9:28 AM, Robert Osfield <[email protected]> 
wrote: 
  Did you modify the OSG to achieve this?  If so could you post the
  changes.  Perhaps this could be made as an runtime option in
  osgViewer.




My application handles all the windowing code itself, so I didn't need to make 
any changes to OSG.


I noticed that GraphicsWindowWin32.cpp hard codes the swap method to 
WGL_SWAP_EXCHANGE_ARB. To apply this workaround the users would just need to 
change this to WGL_SWAP_COPY_ARB and recompile. Having this configurable would 
be ideal, however I'm not very familiar with osgViewer, so I'm probably not the 
best person to make this change, otherwise I would have already submitted a 
patch ;)


Cheers,
Farshid






--------------------------------------------------------------------------------


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--------------------------------------------------------------------------------


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--------------------------------------------------------------------------------


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



--------------------------------------------------------------------------------


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to