Axiom.RenderSystems.DirectX9.D3DMultiRenderTarget.BindSurface C# (CSharp) Метод

BindSurface() публичный Метод

Bind a surface to a certain attachment point.
It does not bind the surface and fails with an exception (ERR_INVALIDPARAMS) if: - Not all bound surfaces have the same size - Not all bound surfaces have the same internal format
public BindSurface ( int attachment, RenderTexture target ) : void
attachment int 0 .. capabilities.MultiRenderTargetCount-1
target Axiom.Graphics.RenderTexture RenderTexture to bind.
Результат void
		public override void BindSurface( int attachment, RenderTexture target )
		{
			Contract.Requires( attachment < Config.MaxMultipleRenderTargets );

			// Get buffer and surface to bind to
			D3DHardwarePixelBuffer buffer = (D3DHardwarePixelBuffer)( target[ "BUFFER" ] );
			Proclaim.NotNull( buffer );

			// Find first non null target
			int y;
			for ( y = 0; y < Config.MaxMultipleRenderTargets && this._targets[ y ] == null; y++ )
				;

			if ( y != Config.MaxMultipleRenderTargets )
			{
				if ( this._targets[ y ].Width != buffer.Width
					&& this._targets[ y ].Height != buffer.Height
					&& PixelUtil.GetNumElemBits( this._targets[ y ].Format ) != PixelUtil.GetNumElemBits( this._targets[ y ].Format ) )
				{
					throw new AxiomException( "MultiRenderTarget surfaces are not the same size or bit depth." );
				}
			}

			this._targets[ attachment ] = buffer;
			this.CheckAndUpdate();
		}