Improved support for texture subload/render to texture in various Texture classes

and RenderStage.
This commit is contained in:
Robert Osfield
2005-11-04 12:08:16 +00:00
parent 89b0ef09a8
commit 4915259878
13 changed files with 123 additions and 33 deletions

View File

@@ -193,6 +193,28 @@ void TextureRectangle::apply(State& state) const
non_const_this->_image = 0;
}
}
else if ( (_textureWidth!=0) && (_textureHeight!=0) && (_internalFormat!=0) )
{
_textureObjectBuffer[contextID] = textureObject = generateTextureObject(
contextID,GL_TEXTURE_RECTANGLE,0,_internalFormat,_textureWidth,_textureHeight,1,0);
textureObject->bind();
applyTexParameters(GL_TEXTURE_RECTANGLE,state);
// no image present, but dimensions at set so lets create the texture
glTexImage2D( GL_TEXTURE_RECTANGLE, 0, _internalFormat,
_textureWidth, _textureHeight, _borderWidth,
_internalFormat,
GL_UNSIGNED_BYTE,
0);
if (_readPBuffer.valid())
{
_readPBuffer->bindPBufferToTexture(GL_FRONT);
}
}
else
{
glBindTexture(GL_TEXTURE_RECTANGLE, 0);