From 174c161daad0360a072860dab20eb415e49e9f0b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 21 Oct 2014 14:47:43 +0000 Subject: [PATCH] Removed --sync related code as it's now integrated into osg::DisplaySettings and osgViewer git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14457 16af8721-9629-0410-8352-f15c8da7e697 --- applications/osgviewer/osgviewer.cpp | 111 --------------------------- 1 file changed, 111 deletions(-) diff --git a/applications/osgviewer/osgviewer.cpp b/applications/osgviewer/osgviewer.cpp index 4ea476a9b..d63726a0d 100644 --- a/applications/osgviewer/osgviewer.cpp +++ b/applications/osgviewer/osgviewer.cpp @@ -33,103 +33,6 @@ #include -#include - -#ifndef GL_ARB_sync -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull -#endif - -class MySwapBuffersCallback : public osg::GraphicsContext::SwapCallback -{ -public: - MySwapBuffersCallback(): - _extensionInitialized(false), - _glFenceSync(0), - _glIsSync(0), - _glDeleteSync(0), - _glClientWaitSync(0), - _glWaitSync(0), - _glGetInteger64v(0), - _glGetSynciv(0), - _previousSync(0) - { - OSG_NOTICE<<"Created Swap callback."<swapBuffersImplementation(); - //glFinish(); - - if (!_extensionInitialized) setUpExtensions(); - - if (_glClientWaitSync) - { - if (_previousSync) - { - unsigned int num_seconds = 1; - GLuint64 timeout = num_seconds * ((GLuint64)1000 * 1000 * 1000); - _glClientWaitSync(_previousSync, 0, timeout); - - _glDeleteSync(_previousSync); - } - - _previousSync = _glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); - } - //gc->getState()->checkGLErrors("after glWaitSync"); - - //OSG_NOTICE<<"After swap"<getOrCreateStateSet()) ); @@ -277,18 +178,6 @@ int main(int argc, char** argv) viewer.realize(); - if (doArbSync) - { - osgViewer::ViewerBase::Contexts contexts; - viewer.getContexts(contexts); - for(osgViewer::ViewerBase::Contexts::iterator itr = contexts.begin(); - itr != contexts.end(); - ++itr) - { - (*itr)->setSwapCallback(new MySwapBuffersCallback); - } - } - return viewer.run(); }