From Romano Magacho, fixes to handle the subloading from Image when the

internal format changes requiring a rebuild of the texture object.
This commit is contained in:
Robert Osfield
2004-01-23 13:25:45 +00:00
parent 34bc8a2471
commit edce2211fa
7 changed files with 12 additions and 12 deletions

View File

@@ -741,16 +741,15 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima
void Texture::applyTexImage2D_subload(State& state, GLenum target, const Image* image, GLsizei inwidth, GLsizei inheight,GLsizei numMipmapLevels) const
void Texture::applyTexImage2D_subload(State& state, GLenum target, const Image* image, GLsizei inwidth, GLsizei inheight, GLint inInternalFormat, GLint numMipmapLevels) const
{
// if we don't have a valid image we can't create a texture!
if (!image || !image->data())
return;
// image size has changed so we have to re-load the image from scratch.
if (image->s()!=inwidth || image->t()!=inheight)
if (image->s()!=inwidth || image->t()!=inheight || image->getInternalTextureFormat()!=inInternalFormat )
{
applyTexImage2D_load(state, target, image, inwidth, inheight,numMipmapLevels);
return;
}