Beispiel #1
0
        internal static SurfaceFormat FromXNASurfaceFormat(XFG.SurfaceFormat format)
        {
            switch (format)
            {
            case XFG.SurfaceFormat.Vector4:
                return(SurfaceFormat.Vector4);

            case XFG.SurfaceFormat.Vector2:
                return(SurfaceFormat.Vector2);

            case XFG.SurfaceFormat.Single:
                return(SurfaceFormat.Single);

            case XFG.SurfaceFormat.Rgba64:
                return(SurfaceFormat.RGBA64);

            case XFG.SurfaceFormat.Rgba1010102:
                return(SurfaceFormat.RGBA1010102);

            case XFG.SurfaceFormat.Rg32:
                return(SurfaceFormat.RG32);

            case XFG.SurfaceFormat.Dxt5:
                return(SurfaceFormat.DXT5);

            case XFG.SurfaceFormat.Dxt3:
                return(SurfaceFormat.DXT3);

            case XFG.SurfaceFormat.Dxt1:
                return(SurfaceFormat.DXT1);

            case XFG.SurfaceFormat.Color:
                return(SurfaceFormat.Color);

            case XFG.SurfaceFormat.Bgra5551:
                return(SurfaceFormat.BGRA5551);

            case XFG.SurfaceFormat.Bgr565:
                return(SurfaceFormat.BGR565);

            case XFG.SurfaceFormat.Alpha8:
                return(SurfaceFormat.Alpha8);

            default:
                throw new InvalidCastException();
            }
        }
        public static PixelFormat ToInteropFormat(XNA.SurfaceFormat fmt)
        {
            switch (fmt)
            {
            case XNA.SurfaceFormat.Alpha8: return(Pixel.Alpha8.Format);

            case XNA.SurfaceFormat.Bgr565: return(Pixel.BGR565.Format);

            case XNA.SurfaceFormat.Bgra4444: return(Pixel.BGRA4444.Format);

            case XNA.SurfaceFormat.Bgra5551: return(Pixel.BGRA5551.Format);

            case XNA.SurfaceFormat.Bgra32: return(Pixel.BGRA32.Format);

            case XNA.SurfaceFormat.Vector4: return(Pixel.BGRA128F.Format);
            }

            throw new NotSupportedException($"{fmt}");
        }
Beispiel #3
0
		//public XFG.DepthStencilBuffer DepthStencil
		//{
		//    get
		//    {
		//        return depthBuffer;
		//    }
		//}

		#endregion Properties

		#region Methods

		private void InitDevice()
		{
			Debug.Assert( _device != null );

			// get our back buffer pixel format
			_bbPixelFormat = _device.DisplayMode.Format;
		}