From 821ca4e5cd821c6891f069850a0b928a2f3a1bcf Mon Sep 17 00:00:00 2001 From: OpenSceneGraph git repository Date: Fri, 10 Nov 2017 16:58:29 +0000 Subject: [PATCH] Revert " following guidance from OpenGL Common Mistakes:" --- src/osg/Texture.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index d43b0d665..25782619f 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -2298,8 +2298,9 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima if (height == 0) height = 1; - glTexImage2D( target, k, _internalFormat, - width, height, _borderWidth, + glTexSubImage2D( target, k, + 0, 0, + width, height, (GLenum)image->getPixelFormat(), (GLenum)image->getDataType(), dataPtr + image->getMipmapOffset(k)); @@ -2602,11 +2603,12 @@ void Texture::applyTexImage2D_subload(State& state, GLenum target, const Image* if (height == 0) height = 1; - glTexImage2D( target, k, _internalFormat, - width, height, _borderWidth, - (GLenum)image->getPixelFormat(), - (GLenum)image->getDataType(), - dataPtr + image->getMipmapOffset(k)); + glTexSubImage2D( target, k, + 0, 0, + width, height, + (GLenum)image->getPixelFormat(), + (GLenum)image->getDataType(), + dataPtr + image->getMipmapOffset(k)); width >>= 1; height >>= 1;