//public override Axiom.Core.Texture Create(string name, TextureType type) {
        //    D3DTexture texture = new D3DTexture(name, device, TextureUsage.Default, type);

        //    // Handle 32-bit texture settings
        //    texture.Enable32Bit(is32Bit);

        //    return texture;
        //}

        /// <summary>
        ///    Used to create a blank D3D texture.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="type"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="numMipMaps"></param>
        /// <param name="format"></param>
        /// <param name="usage"></param>
        /// <returns></returns>
        //public override Axiom.Core.Texture CreateManual(string name, TextureType type, int width, int height, int numMipMaps, Axiom.Media.PixelFormat format, TextureUsage usage) {
        //    D3DTexture texture = new D3DTexture(name, device, type, width, height, numMipMaps, format, usage);
        //    texture.Enable32Bit(is32Bit);
        //    return texture;
        //}

        // This ends up just discarding the format passed in; the C# methods don't let you supply
        // a "recommended" format.  Ah well.
        public override Axiom.Media.PixelFormat GetNativeFormat(TextureType ttype, Axiom.Media.PixelFormat format, TextureUsage usage)
        {
            // Basic filtering
            D3D.Format d3dPF = D3DHelper.ConvertEnum(D3DHelper.GetClosestSupported(format));

            // Calculate usage
            D3D.Usage d3dusage = 0;
            D3D.Pool  pool     = D3D.Pool.Managed;
            if ((usage & TextureUsage.RenderTarget) != 0)
            {
                d3dusage |= D3D.Usage.RenderTarget;
                pool      = D3D.Pool.Default;
            }
            if ((usage & TextureUsage.Dynamic) != 0)
            {
                d3dusage |= D3D.Usage.Dynamic;
                pool      = D3D.Pool.Default;
            }

            // Use D3DX to adjust pixel format
            switch (ttype)
            {
            case TextureType.OneD:
            case TextureType.TwoD:
                TextureRequirements tReqs;
                TextureLoader.CheckTextureRequirements(device, d3dusage, pool, out tReqs);
                d3dPF = tReqs.Format;
                break;

            case TextureType.ThreeD:
                VolumeTextureRequirements volReqs;
                TextureLoader.CheckVolumeTextureRequirements(device, pool, out volReqs);
                d3dPF = volReqs.Format;
                break;

            case TextureType.CubeMap:
                CubeTextureRequirements cubeReqs;
                TextureLoader.CheckCubeTextureRequirements(device, d3dusage, pool, out cubeReqs);
                d3dPF = cubeReqs.Format;
                break;
            }
            ;
            return(D3DHelper.ConvertEnum(d3dPF));
        }