Moved Drawable across to using osg::buffered_value.

Added new osg::State::setInterleavedArray() method.

Added new osg::Group::setNode(uint,Node*) method.

Cleaned up and fixed the osg::Texture's handling of dirtyTextureParamters().
This commit is contained in:
Robert Osfield
2002-11-19 10:56:59 +00:00
parent 42fb3c5987
commit 5fca8ea229
11 changed files with 68 additions and 82 deletions

View File

@@ -8,15 +8,19 @@
#include <osg/Node>
#include <algorithm>
#include <map>
#include <set>
using namespace osg;
Drawable::DeletedDisplayListCache Drawable::s_deletedDisplayListCache;
// static cache of deleted display lists which can only
// by completely deleted once the appropriate OpenGL context
// is set. Used osg::Drawable::deleteDisplayList(..) and flushDeletedDisplayLists(..) below.
typedef std::map<GLuint,std::set<GLuint> > DeletedDisplayListCache;
static DeletedDisplayListCache s_deletedDisplayListCache;
Drawable::Drawable()
{
_globjList.resize(DisplaySettings::instance()->getMaxNumberOfGraphicsContexts(),0);
_bbox_computed = false;
// Note, if your are defining a subclass from drawable which is
@@ -26,7 +30,6 @@ Drawable::Drawable()
// dynamic updating of data.
_supportsDisplayList = true;
_useDisplayList = true;
}
Drawable::Drawable(const Drawable& drawable,const CopyOp& copyop):
@@ -38,10 +41,10 @@ Drawable::Drawable(const Drawable& drawable,const CopyOp& copyop):
_shape(copyop(drawable._shape.get())),
_supportsDisplayList(drawable._supportsDisplayList),
_useDisplayList(drawable._useDisplayList),
_globjList(drawable._globjList),
_drawCallback(drawable._drawCallback),
_cullCallback(drawable._cullCallback)
{}
{
}
Drawable::~Drawable()
{
@@ -90,9 +93,6 @@ void Drawable::compile(State& state)
// current OpenGL context.
uint contextID = state.getContextID();
// fill in array if required.
while (_globjList.size()<=contextID) _globjList.push_back(0);
// get the globj for the current contextID.
uint& globj = _globjList[contextID];