root/OpenSceneGraph/trunk/src/osg/GLObjects.cpp @ 7074

Revision 7074, 2.7 kB (checked in by robert, 7 years ago)

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.

Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under 
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13#include <osg/GLObjects>
14
15#include <osg/Texture>
16#include <osg/VertexProgram>
17#include <osg/FragmentProgram>
18#include <osg/Shader>
19#include <osg/BufferObject>
20#include <osg/FrameBufferObject>
21#include <osg/Drawable>
22
23void osg::flushDeletedGLObjects(unsigned int contextID, double currentTime, double& availableTime)
24{
25    osg::FrameBufferObject::flushDeletedFrameBufferObjects(contextID,currentTime,availableTime);
26    osg::RenderBuffer::flushDeletedRenderBuffers(contextID,currentTime,availableTime);
27    osg::Texture::flushDeletedTextureObjects(contextID,currentTime,availableTime);
28    osg::Drawable::flushDeletedDisplayLists(contextID,availableTime);
29    osg::Drawable::flushDeletedVertexBufferObjects(contextID,currentTime,availableTime);
30    osg::VertexProgram::flushDeletedVertexProgramObjects(contextID,currentTime,availableTime);
31    osg::FragmentProgram::flushDeletedFragmentProgramObjects(contextID,currentTime,availableTime);
32    osg::Program::flushDeletedGlPrograms(contextID,currentTime,availableTime);
33    osg::Shader::flushDeletedGlShaders(contextID,currentTime,availableTime);
34    osg::BufferObject::flushDeletedBufferObjects(contextID,currentTime,availableTime);
35}
36
37void osg::flushAllDeletedGLObjects(unsigned int contextID)
38{
39    double currentTime = DBL_MAX;
40    double availableTime = DBL_MAX;
41    osg::FrameBufferObject::flushDeletedFrameBufferObjects(contextID,currentTime,availableTime);
42    osg::RenderBuffer::flushDeletedRenderBuffers(contextID,currentTime,availableTime);
43    osg::Texture::flushAllDeletedTextureObjects(contextID);
44    osg::Drawable::flushAllDeletedDisplayLists(contextID);
45    osg::Drawable::flushDeletedVertexBufferObjects(contextID,currentTime,availableTime);
46    osg::VertexProgram::flushDeletedVertexProgramObjects(contextID,currentTime,availableTime);
47    osg::FragmentProgram::flushDeletedFragmentProgramObjects(contextID,currentTime,availableTime);
48    osg::Program::flushDeletedGlPrograms(contextID,currentTime,availableTime);
49    osg::Shader::flushDeletedGlShaders(contextID,currentTime,availableTime);
50    osg::BufferObject::flushDeletedBufferObjects(contextID,currentTime,availableTime);
51}
Note: See TracBrowser for help on using the browser.