protected void CreateRenderTextures( bool update )
{
if ( update )
{
Debug.Assert( sliceTRT.Count == Depth );
foreach ( D3DRenderTexture trt in sliceTRT )
trt.Rebind( this );
return;
}
DestroyRenderTextures();
if ( surface == null )
throw new Exception( "Rendering to 3D slices not supported yet for Direct3D; in " +
"D3DHardwarePixelBuffer.CreateRenderTexture" );
// Create render target for each slice
sliceTRT.Clear();
Debug.Assert( Depth == 1 );
for ( int zoffset = 0; zoffset < Depth; ++zoffset )
{
string name = "rtt/" + this.ID;
RenderTexture trt = new D3DRenderTexture( name, this );
sliceTRT.Add( trt );
Root.Instance.RenderSystem.AttachRenderTarget( trt );
}
}