From 6d1d1bb00053690a55d8e2a401aab1edd42c9257 Mon Sep 17 00:00:00 2001 From: OpenSceneGraph git repository Date: Fri, 2 Feb 2018 09:54:31 +0000 Subject: [PATCH] Revert "BindingTextureImage: a more complex condition for _texture->apply ?" --- include/osg/Texture | 3 --- include/osg/TextureBuffer | 6 +++--- src/osg/BindImageTexture.cpp | 5 ++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/osg/Texture b/include/osg/Texture index 2376619c9..a4f744f68 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -730,8 +730,6 @@ class OSG_EXPORT Texture : public osg::StateAttribute void setShadowAmbient(float shadow_ambient) { _shadow_ambient = shadow_ambient; } float getShadowAmbient() const { return _shadow_ambient; } - /** Gets the texture BufferData */ - virtual const BufferData* getBufferData() const { return getImage(0); } /** Sets the texture image for the specified face. */ virtual void setImage(unsigned int face, Image* image) = 0; @@ -741,7 +739,6 @@ class OSG_EXPORT Texture : public osg::StateAttribute /** Gets the texture image for the specified face. */ virtual Image* getImage(unsigned int face) = 0; - /** Gets the const texture image for specified face. */ virtual const Image* getImage(unsigned int face) const = 0; diff --git a/include/osg/TextureBuffer b/include/osg/TextureBuffer index dcdeaf576..7a5c603c6 100644 --- a/include/osg/TextureBuffer +++ b/include/osg/TextureBuffer @@ -84,11 +84,11 @@ class OSG_EXPORT TextureBuffer : public Texture /** Bind the texture buffer.*/ virtual void apply(State& state) const; - /** Set BufferData attached */ + /** Set setBufferData attached */ void setBufferData(BufferData *bo); - /** Get BufferData attached */ - virtual const BufferData * getBufferData() const { return _bufferData.get(); } + /** Set setBufferData attached */ + const BufferData * getBufferData()const {return _bufferData.get();} protected : virtual ~TextureBuffer(); diff --git a/src/osg/BindImageTexture.cpp b/src/osg/BindImageTexture.cpp index d5a1361bf..592ffa2fb 100644 --- a/src/osg/BindImageTexture.cpp +++ b/src/osg/BindImageTexture.cpp @@ -19,9 +19,8 @@ void BindImageTexture::apply(osg::State&state) const { if(_target.valid()) { - Texture::TextureObject *to = _target->getTextureObject( state.getContextID() ); - GLBufferObject *globj = _target->getBufferData()->getBufferObject()->getGLBufferObject( state.getContextID() ); - if( !globj || globj->isDirty() ) + osg::Texture::TextureObject *to = _target->getTextureObject( state.getContextID() ); + if( !to ) { // _target never been applied yet _target->apply(state);