Axiom.RenderSystems.Xna.XnaHardwarePixelBuffer.CreateRenderTextures C# (CSharp) Method

CreateRenderTextures() protected method

Create (or update) render textures for slices
protected CreateRenderTextures ( bool update ) : void
update bool are we updating an existing texture
return void
		protected void CreateRenderTextures( bool update )
		{
			if ( update )
			{
				Debug.Assert( sliceTRT.Count == Depth );
				foreach ( XnaRenderTexture trt in sliceTRT )
					trt.Rebind( this );
				return;
			}

			DestroyRenderTextures();
			// 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 XnaRenderTexture( name, this );
				sliceTRT.Add( trt );
				Root.Instance.RenderSystem.AttachRenderTarget( trt );
			}
		}