private void SetSrcAttributes( int width, int height, int depth, PixelFormat format )
{
SrcWidth = width;
SrcHeight = height;
SrcDepth = PixelUtil.GetNumElemBits( format );
HasAlpha = PixelUtil.HasAlpha( format );
// say to the world what we are doing
const string RenderTargetFormat = "D3D9 : Creating {0} RenderTarget, name : '{1}' with {2} mip map levels.";
const string TextureFormat = "D3D9 : Loading {0} Texture, image name : '{1}' with {2} mip map levels.";
string formatStr = ( Usage & TextureUsage.RenderTarget ) == TextureUsage.RenderTarget ? RenderTargetFormat : TextureFormat;
switch ( this.TextureType )
{
case TextureType.OneD:
LogManager.Instance.Write( String.Format( formatStr, TextureType.OneD, this.Name, MipmapCount ) );
break;
case TextureType.TwoD:
LogManager.Instance.Write( String.Format( formatStr, TextureType.TwoD, this.Name, MipmapCount ) );
break;
case TextureType.ThreeD:
LogManager.Instance.Write( String.Format( formatStr, TextureType.ThreeD, this.Name, MipmapCount ) );
break;
case TextureType.CubeMap:
LogManager.Instance.Write( String.Format( formatStr, TextureType.CubeMap, this.Name, MipmapCount ) );
break;
default:
this.FreeInternalResources();
throw new Exception( "Unknown texture type" );
}
}