Hi all,

have I overlooked something or doesn't OSG have methods to control sync-to-vblank at runtime? GraphicsContext has a 'vsync' member but the only location where that is used is in GraphicsWindowCarbon and is only checked once during context setup (realizeImplementation).

Effectively there is no way that I know of to turn vsync off on OS X short of modifying the code. Windows and Linux can at least control it using driver settings or environment variables.

My first idea was to add a 'set/getSyncToVBlank' method to GraphicsWindow that would record the new setting in the traits (if valid) and enable/disable vsync as necessary (I have it working for OS X using aglSwapInterval; Win32 could use wglSwapIntervalEXT and Linux glXSwapInterval/glXGetVideoSyncSGI/glXWaitVideoSyncSGI).

But traits can be shared among different contexts and this implementation would do the wrong thing: it would turn vsync on for the one GraphicsWindow called but not any others sharing the same traits. It would however report the new vsync setting for all of them; certainly not desirable.

So my questions are:
- did I miss existing support for vsync?
- does it make sense for different contexts to have different vsync setting?
- what about off-screen/RTT contexts? Surely they don't need that, but they don't call SwapBuffers anyway. - what about multiple on-screen contexts like multi-screen setups? Does that need extra synchronization?

Thoughts?
Cheers,
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to