Added osg::BufferObject and a made a number associated to accomodate this

new class. osg::BufferObject wraps up OpenGL pixel and array buffer objects.
Currently implementation is work in progress.
This commit is contained in:
Robert Osfield
2005-02-09 10:39:45 +00:00
parent 1a9b5ddbbf
commit 117c791a3b
34 changed files with 1017 additions and 253 deletions

View File

@@ -108,12 +108,12 @@ TextureCubeMap::TextureCubeMap(const TextureCubeMap& text,const CopyOp& copyop):
_images[4] = copyop(text._images[4].get());
_images[5] = copyop(text._images[5].get());
_modifiedTag[0].setAllElementsTo(0);
_modifiedTag[1].setAllElementsTo(0);
_modifiedTag[2].setAllElementsTo(0);
_modifiedTag[3].setAllElementsTo(0);
_modifiedTag[4].setAllElementsTo(0);
_modifiedTag[5].setAllElementsTo(0);
_modifiedCount[0].setAllElementsTo(0);
_modifiedCount[1].setAllElementsTo(0);
_modifiedCount[2].setAllElementsTo(0);
_modifiedCount[3].setAllElementsTo(0);
_modifiedCount[4].setAllElementsTo(0);
_modifiedCount[5].setAllElementsTo(0);
}
@@ -167,7 +167,7 @@ int TextureCubeMap::compare(const StateAttribute& sa) const
void TextureCubeMap::setImage( unsigned int face, Image* image)
{
_images[face] = image;
_modifiedTag[face].setAllElementsTo(0);
_modifiedCount[face].setAllElementsTo(0);
}
Image* TextureCubeMap::getImage(unsigned int face)
@@ -223,10 +223,10 @@ void TextureCubeMap::apply(State& state) const
for (int n=0; n<6; n++)
{
const osg::Image* image = _images[n].get();
if (image && getModifiedTag((Face)n,contextID) != image->getModifiedTag())
if (image && getModifiedCount((Face)n,contextID) != image->getModifiedCount())
{
applyTexImage2D_subload( state, faceTarget[n], _images[n].get(), _textureWidth, _textureHeight, _internalFormat, _numMipmapLevels);
getModifiedTag((Face)n,contextID) = image->getModifiedTag();
getModifiedCount((Face)n,contextID) = image->getModifiedCount();
}
}
}
@@ -278,7 +278,7 @@ void TextureCubeMap::apply(State& state) const
{
applyTexImage2D_load( state, faceTarget[n], image, _textureWidth, _textureHeight, _numMipmapLevels);
}
getModifiedTag((Face)n,contextID) = image->getModifiedTag();
getModifiedCount((Face)n,contextID) = image->getModifiedCount();
}