Added support for setting the texture subload width and height within

osg::Texture.  The values default to 0, and in this state they are
sizes of the glTexSubImage2D are taken from the source image size.  This
allows the previous setup with no settings for subload size to work as
before.
This commit is contained in:
Robert Osfield
2002-03-27 22:51:58 +00:00
parent 7e2c82f141
commit 33c89c3be0
4 changed files with 44 additions and 8 deletions

View File

@@ -205,7 +205,7 @@ void TextureCubeMap::apply(State& state) const
{
glTexSubImage2D(faceTarget[n], 0,
_subloadOffsX, _subloadOffsY,
_images[n]->s(), _images[n]->t(),
(_subloadWidth>0)?_subloadWidth:_images[n]->s(), (_subloadHeight>0)?_subloadHeight:_images[n]->t(),
(GLenum) _images[n]->pixelFormat(), (GLenum) _images[n]->dataType(),
_images[n]->data());
// update the modified flag to show that the image has been loaded.