texture buffer

Blitz3D Forums/Blitz3D Programming/texture buffer

I wish to capture the 3d display as a texture. However, with the following code (as a subroutine in a larger main loop), my cube remains blank...

cube_text=CreateTexture(128,128)
SetBuffer TextureBuffer(cube_text)
RenderWorld
EntityTexture cube,cube_text
FreeTexture cube_text
SetBuffer BackBuffer()


I can't see what is wrong with this.

RenderWorld always renders to the BackBuffer. What you have to do is render and then use CopyRect to copy the BackBuffer to your texture buffer.