Show
Ignore:
Timestamp:
07/06/07 15:08:51 (7 years ago)
Author:
robert
Message:

Added include/osg/GLObjects + .cpp which provide osg::flush*DeletedGLObjects() methods.

Added and cleaned up DeleteHandler? calls in osgViewer to help avoid crashes on exit.

Changed DatabasePager? across to dynamically checcking osg::getCompileContext(..)

Updated wrappers.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgUtil/SceneView.cpp

    r7062 r7074  
    1717#include <osg/Timer> 
    1818#include <osg/GLExtensions> 
     19#include <osg/GLObjects> 
    1920#include <osg/Notify> 
    2021#include <osg/Texture> 
    21 #include <osg/VertexProgram> 
    22 #include <osg/FragmentProgram> 
    2322#include <osg/AlphaFunc> 
    2423#include <osg/TexEnv> 
     
    2625#include <osg/LightModel> 
    2726#include <osg/CollectOccludersVisitor> 
    28 #include <osg/Shader> 
    29 #include <osg/BufferObject> 
    3027 
    3128#include <osg/GLU> 
     
    836833    _requiresFlush = false; 
    837834     
    838     double availableTime = 100.0f; 
     835    osg::flushAllDeletedGLObjects(getState()->getContextID()); 
     836 } 
     837 
     838void SceneView::flushDeletedGLObjects(double& availableTime) 
     839{ 
     840    osg::State* state = _renderInfo.getState(); 
     841 
     842    _requiresFlush = false; 
     843 
    839844    double currentTime = state->getFrameStamp()?state->getFrameStamp()->getReferenceTime():0.0; 
    840      
    841     osg::FrameBufferObject::flushDeletedFrameBufferObjects(state->getContextID(),currentTime,availableTime); 
    842     osg::RenderBuffer::flushDeletedRenderBuffers(state->getContextID(),currentTime,availableTime); 
    843     osg::Texture::flushAllDeletedTextureObjects(state->getContextID()); 
    844     osg::Drawable::flushAllDeletedDisplayLists(state->getContextID()); 
    845     osg::Drawable::flushDeletedVertexBufferObjects(state->getContextID(),currentTime,availableTime); 
    846     osg::VertexProgram::flushDeletedVertexProgramObjects(state->getContextID(),currentTime,availableTime); 
    847     osg::FragmentProgram::flushDeletedFragmentProgramObjects(state->getContextID(),currentTime,availableTime); 
    848     osg::Program::flushDeletedGlPrograms(state->getContextID(),currentTime,availableTime); 
    849     osg::Shader::flushDeletedGlShaders(state->getContextID(),currentTime,availableTime); 
    850     osg::BufferObject::flushDeletedBufferObjects(state->getContextID(),currentTime,availableTime); 
    851  } 
    852  
    853 void SceneView::flushDeletedGLObjects(double& availableTime) 
    854 { 
    855     osg::State* state = _renderInfo.getState(); 
    856  
    857     _requiresFlush = false; 
    858  
    859     double currentTime = state->getFrameStamp()?state->getFrameStamp()->getReferenceTime():0.0; 
    860  
    861     osg::FrameBufferObject::flushDeletedFrameBufferObjects(state->getContextID(),currentTime,availableTime); 
    862     osg::RenderBuffer::flushDeletedRenderBuffers(state->getContextID(),currentTime,availableTime); 
    863     osg::Texture::flushDeletedTextureObjects(state->getContextID(),currentTime,availableTime); 
    864     osg::Drawable::flushDeletedDisplayLists(state->getContextID(),availableTime); 
    865     osg::Drawable::flushDeletedVertexBufferObjects(state->getContextID(),currentTime,availableTime); 
    866     osg::VertexProgram::flushDeletedVertexProgramObjects(state->getContextID(),currentTime,availableTime); 
    867     osg::FragmentProgram::flushDeletedFragmentProgramObjects(state->getContextID(),currentTime,availableTime); 
    868     osg::Program::flushDeletedGlPrograms(state->getContextID(),currentTime,availableTime); 
    869     osg::Shader::flushDeletedGlShaders(state->getContextID(),currentTime,availableTime); 
    870     osg::BufferObject::flushDeletedBufferObjects(state->getContextID(),currentTime,availableTime); 
     845 
     846    osg::flushDeletedGLObjects(getState()->getContextID(), currentTime, availableTime); 
    871847} 
    872848