Added osg::SyncSwapBuffersCallback to include/osg/GraphicsContext and support for enabling it to include/osg/DisplaySettings, and to the Viewer/CompositeViewer::realize() methods.

To enable the sync of swap buffers set the env var OSG_SYNC_SWAP_BUFFERS to ON or 1, to switch off set to OFF or 0.

One can also use the --sync command line option for application that pass on command line options to the osg::DisplaySettings::instance().


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14456 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-10-21 14:46:12 +00:00
parent fec06828cf
commit 4c1fd06252
6 changed files with 147 additions and 1 deletions

View File

@@ -544,6 +544,8 @@ void Viewer::realize()
{
osg::GraphicsContext* gc = *citr;
if (ds->getSyncSwapBuffers()) gc->setSwapCallback(new osg::SyncSwapBuffersCallback);
// set the pool sizes, 0 the default will result in no GL object pools.
gc->getState()->setMaxTexturePoolSize(maxTexturePoolSize);
gc->getState()->setMaxBufferObjectPoolSize(maxBufferObjectPoolSize);