From 0532c93c8c031b036950aaac9d71a16eb5a8f1d6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 14 Aug 2015 15:25:08 +0000 Subject: [PATCH] Corrected the Subload::generateTextureObject() return type to make it consistent with Texture::generateTextureObject(..) git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15117 16af8721-9629-0410-8352-f15c8da7e697 --- include/osg/Texture2D | 4 ++-- src/osg/Texture2D.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/osg/Texture2D b/include/osg/Texture2D index d04deb41f..0e9b0da1f 100644 --- a/include/osg/Texture2D +++ b/include/osg/Texture2D @@ -93,9 +93,9 @@ class OSG_EXPORT Texture2D : public Texture return texture.textureObjectValid(state); } - virtual TextureObject* generateTextureObject(const Texture2D& texture, State& state) const + virtual osg::ref_ptr generateTextureObject(const Texture2D& texture, State& state) const { - return osg::Texture::generateTextureObject(&texture, state.getContextID(), GL_TEXTURE_2D).release(); + return osg::Texture::generateTextureObject(&texture, state.getContextID(), GL_TEXTURE_2D); } virtual void load(const Texture2D& texture,State& state) const = 0; diff --git a/src/osg/Texture2D.cpp b/src/osg/Texture2D.cpp index cea45af08..453a6bd24 100644 --- a/src/osg/Texture2D.cpp +++ b/src/osg/Texture2D.cpp @@ -220,7 +220,8 @@ void Texture2D::apply(State& state) const } else if (_subloadCallback.valid()) { - _textureObjectBuffer[contextID] = textureObject = _subloadCallback->generateTextureObject(*this, state); + _textureObjectBuffer[contextID] = _subloadCallback->generateTextureObject(*this, state); + textureObject = _textureObjectBuffer[contextID].get(); textureObject->bind();