David Johansson wrote:
Okay, it seems to work nice on my machine. Also, most (all?) games
using openGL can set V-Sync at runtime..
I'll get to tracing that 'v' key as soon as i have time, thanks for the input!

  I think that the 'v' key actually toggles "block-on-vsync", a different 
condition.

  Here's the code I use:

// Code from this cited message:
// Date: Tue, 21 Mar 2006 21:07:35 -0800
// From: "Farshid Lashkari" <[EMAIL PROTECTED]>
// To: "osg users" <[email protected]>
// Subject: Re: [osg-users] Can we toggle block on vsync using a RenderSurface 
and SceneView?

typedef BOOL (APIENTRY *PFNWGLSWAPINTERVALFARPROC)( int );
PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = NULL;

// Enable (1) or disable (0) VSync
// I believe this must be called with a valid GL context
void setVSync(int interval)
{
const unsigned char *extensions = glGetString( GL_EXTENSIONS );

if( extensions == 0 || strstr( (const char *)extensions, "WGL_EXT_swap_control" ) == 0 ) return;

wglSwapIntervalEXT = 
(PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress("wglSwapIntervalEXT" );
if( wglSwapIntervalEXT ) wglSwapIntervalEXT(interval);
} // setVSync


David


--
Chris 'Xenon' Hanson aka Eric Hammil | http://www.3DNature.com/ eric at logrus
 "I set the wheels in motion, turn up all the machines, activate the programs,
  and run behind the scenes. I set the clouds in motion, turn up light and 
sound,
  activate the window, and watch the world go 'round." -Prime Mover, Rush.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to