Improved support for texture subload/render to texture in various Texture classes
and RenderStage.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user