From Jannik Heller, "I have added new functions Texture::generateAndAssignTextureObject mirroring the Texture::generateTextureObject functions.

I have left the Texture::generateTextureObject functions intact as I'm not sure if/how it's used outside the core OSG. If you feel that compatibility isn't important in that area feel free to drop it.

While testing the build with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION=OFF I found a compile error in GlyphGeometry.cpp that was entirely unrelated to the changes I've made. The fix is included in the patch.

There is one thing left to fix and that is Texture2D::SubloadCallback:

        class OSG_EXPORT SubloadCallback : public Referenced
        {
            public:
                ....
                virtual TextureObject* generateTextureObject(const Texture2D& texture, State& state) const
                {
                    return osg::Texture::generateTextureObject(&texture, state.getContextID(), GL_TEXTURE_2D);
                }
                ...
         }"
         


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14879 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2015-06-01 10:50:44 +00:00
parent 44c406e167
commit 78a01ce2a5
12 changed files with 79 additions and 59 deletions

View File

@@ -218,7 +218,7 @@ void TextureRectangle::apply(State& state) const
else if (_subloadCallback.valid())
{
// we don't have a applyTexImage1D_subload yet so can't reuse.. so just generate a new texture object.
_textureObjectBuffer[contextID] = textureObject = generateTextureObject(this, contextID,GL_TEXTURE_RECTANGLE);
textureObject = generateAndAssignTextureObject(contextID,GL_TEXTURE_RECTANGLE);
textureObject->bind();
@@ -247,8 +247,8 @@ void TextureRectangle::apply(State& state) const
_textureWidth = image->s();
_textureHeight = image->t();
_textureObjectBuffer[contextID] = textureObject = generateTextureObject(
this, contextID,GL_TEXTURE_RECTANGLE,1,_internalFormat,_textureWidth,_textureHeight,1,0);
textureObject = generateAndAssignTextureObject(
contextID,GL_TEXTURE_RECTANGLE,1,_internalFormat,_textureWidth,_textureHeight,1,0);
textureObject->bind();
@@ -273,8 +273,8 @@ void TextureRectangle::apply(State& state) const
}
else if ( (_textureWidth!=0) && (_textureHeight!=0) && (_internalFormat!=0) )
{
_textureObjectBuffer[contextID] = textureObject = generateTextureObject(
this, contextID,GL_TEXTURE_RECTANGLE,0,_internalFormat,_textureWidth,_textureHeight,1,0);
textureObject = generateAndAssignTextureObject(
contextID,GL_TEXTURE_RECTANGLE,0,_internalFormat,_textureWidth,_textureHeight,1,0);
textureObject->bind();
@@ -493,7 +493,7 @@ void TextureRectangle::copyTexImage2D(State& state, int x, int y, int width, int
// switch off mip-mapping.
//
_textureObjectBuffer[contextID] = textureObject = generateTextureObject(this, contextID,GL_TEXTURE_RECTANGLE);
textureObject = generateAndAssignTextureObject(contextID,GL_TEXTURE_RECTANGLE);
textureObject->bind();