On Wed, Apr 21, 2010 at 6:04 PM, Robert Osfield
<[email protected]> wrote:
> I'll see if I can complete that this evening.
My changes are now checked in. The part you guys need to look at is
GrpahicsWindowWin32::setSyncToVBlank(bool) which now looks like:
void GraphicsWindowWin32::setSyncToVBlank( bool on )
{
if (_traits.valid())
{
_traits->vsync = on;
}
#if 0
// we ought to properly check if the extension is listed as
supported rather than just
// if the function pointer resolves through wglGetProcAddress, but
in practice everything
// supports this extension
typedef BOOL (APIENTRY *PFNWGLSWAPINTERVALFARPROC)( int );
PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = 0;
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress(
"wglSwapIntervalEXT" );
if( wglSwapIntervalEXT )
{
int swapInterval = (on ? 1 : 0);
wglSwapIntervalEXT(swapInterval);
OSG_INFO << "GraphicsWindowWin32::setSyncToVBlank " << (on ?
"on" : "off") << std::endl;
}
else
{
OSG_INFO << "GraphicsWindowWin32::setSyncToVBlank(bool) not
supported" << std::endl;
}
#else
OSG_INFO << "GraphicsWindowWin32::setSyncToVBlank(bool) not yet
implemented."<< std::endl;
#endf
}
Fingers crossed I haven't broken the build...
One thing that the changes GraphicsWindow::realizeImplementation()
made me think about is that a boo for Traits::vsync is not really
sufficient. Users don't just want to switch it on or off, they may
also want to leave it as what ever the driver is currently defaulting
too. An enum therefore would probably be most appropriate.
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org