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

Revision 10600, 3.5 kB (checked in by robert, 5 years ago)

Introduced new BufferObject? design + implementation in preperation of implementing a pool system for buffer objects

RevLine 
[7074]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>
[7790]22#include <osg/OcclusionQueryNode>
[7074]23
24void osg::flushDeletedGLObjects(unsigned int contextID, double currentTime, double& availableTime)
25{
[10600]26    osg::GLBufferObject::flushDeletedBufferObjects(contextID,currentTime,availableTime);
[7074]27    osg::Drawable::flushDeletedDisplayLists(contextID,availableTime);
28    osg::FragmentProgram::flushDeletedFragmentProgramObjects(contextID,currentTime,availableTime);
[7773]29    osg::FrameBufferObject::flushDeletedFrameBufferObjects(contextID,currentTime,availableTime);
[7074]30    osg::Program::flushDeletedGlPrograms(contextID,currentTime,availableTime);
[7773]31    osg::RenderBuffer::flushDeletedRenderBuffers(contextID,currentTime,availableTime);
[7074]32    osg::Shader::flushDeletedGlShaders(contextID,currentTime,availableTime);
[7773]33    osg::Texture::flushDeletedTextureObjects(contextID,currentTime,availableTime);
34    osg::VertexProgram::flushDeletedVertexProgramObjects(contextID,currentTime,availableTime);
[7790]35    osg::OcclusionQueryNode::flushDeletedQueryObjects(contextID,currentTime,availableTime);
[7074]36}
37
38void osg::flushAllDeletedGLObjects(unsigned int contextID)
39{
40    double currentTime = DBL_MAX;
41    double availableTime = DBL_MAX;
[10600]42    osg::GLBufferObject::flushDeletedBufferObjects(contextID,currentTime,availableTime);
[7074]43    osg::Drawable::flushAllDeletedDisplayLists(contextID);
44    osg::FragmentProgram::flushDeletedFragmentProgramObjects(contextID,currentTime,availableTime);
[7773]45    osg::FrameBufferObject::flushDeletedFrameBufferObjects(contextID,currentTime,availableTime);
[7074]46    osg::Program::flushDeletedGlPrograms(contextID,currentTime,availableTime);
[7773]47    osg::RenderBuffer::flushDeletedRenderBuffers(contextID,currentTime,availableTime);
[7074]48    osg::Shader::flushDeletedGlShaders(contextID,currentTime,availableTime);
[7773]49    osg::Texture::flushAllDeletedTextureObjects(contextID);
50    osg::VertexProgram::flushDeletedVertexProgramObjects(contextID,currentTime,availableTime);
[7790]51    osg::OcclusionQueryNode::flushDeletedQueryObjects(contextID,currentTime,availableTime);
[7074]52}
53
[7773]54void osg::discardAllDeletedGLObjects(unsigned int contextID)
55{
[10600]56    osg::GLBufferObject::discardDeletedBufferObjects(contextID);
[7773]57    osg::Drawable::discardAllDeletedDisplayLists(contextID);
58    osg::FragmentProgram::discardDeletedFragmentProgramObjects(contextID);
59    osg::FrameBufferObject::discardDeletedFrameBufferObjects(contextID);
60    osg::Program::discardDeletedGlPrograms(contextID);
61    osg::RenderBuffer::discardDeletedRenderBuffers(contextID);
62    osg::Shader::discardDeletedGlShaders(contextID);
63    osg::Texture::discardAllDeletedTextureObjects(contextID);
64    osg::VertexProgram::discardDeletedVertexProgramObjects(contextID);
[7790]65    osg::OcclusionQueryNode::discardDeletedQueryObjects(contextID);
[7773]66}
Note: See TracBrowser for help on using the browser.