public static IDepthStencilState New(VideoTypes videoType, IDisposableResource parent, IDepthStencilStateDesc desc)
        {
            IDepthStencilState api = null;

            #if WIN32
            if (videoType == VideoTypes.D3D9) api = new D3D9.DepthStencilState(parent, desc);
            #endif

            #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11) api = new D3D11.DepthStencilState(parent, desc);
            #endif

            #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL) api = new OpenGL.DepthStencilState(parent, desc);
            #endif

            #if XNA
            if (videoType == VideoTypes.XNA) api = new XNA.DepthStencilState(parent, desc);
            #endif

            #if VITA
            if (videoType == VideoTypes.Vita) api = new Vita.DepthStencilState(parent, desc);
            #endif

            if (api == null) Debug.ThrowError("DepthStencilStateAPI", "Unsuported InputType: " + videoType);
            return api;
        }
示例#2
0
        public DepthStencilState(IDisposableResource parent, IDepthStencilStateDesc desc)
            : base(parent)
        {
            var video = parent.FindParentOrSelfWithException <Video>();

            com = new DepthStencilStateCom(video.com, ((DepthStencilStateDesc)desc).com);
        }
示例#3
0
        public static IDepthStencilStateDesc New(VideoTypes videoType, DepthStencilStateTypes type)
        {
            IDepthStencilStateDesc api = null;

                        #if WIN32
            if (videoType == VideoTypes.D3D9)
            {
                api = new D3D9.DepthStencilStateDesc(type);
            }
                        #endif

                        #if WIN32 || WINRT || WP8
            if (videoType == VideoTypes.D3D11)
            {
                api = new D3D11.DepthStencilStateDesc(type);
            }
                        #endif

                        #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl
            if (videoType == VideoTypes.OpenGL)
            {
                api = new OpenGL.DepthStencilStateDesc(type);
            }
                        #endif

                        #if XNA
            if (videoType == VideoTypes.XNA)
            {
                api = new XNA.DepthStencilStateDesc(type);
            }
                        #endif

                        #if VITA
            if (videoType == VideoTypes.Vita)
            {
                api = new Vita.DepthStencilStateDesc(type);
            }
                        #endif

            if (api == null)
            {
                Debug.ThrowError("DepthStencilStateDescAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
        public DepthStencilState(IDisposableResource parent, IDepthStencilStateDesc desc)
            : base(parent)
        {
            try
            {
                var video = parent.FindParentOrSelfWithException<Video>();

                com = new DepthStencilStateCom();
                var error = com.Init(video.com, ((DepthStencilStateDesc)desc).com);

                if (error == DepthStencilStateError.DepthStencil) Debug.ThrowError("DepthStencil", "Failed to create DepthStencil");
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }
示例#5
0
        public DepthStencilState(IDisposableResource parent, IDepthStencilStateDesc desc)
            : base(parent)
        {
            try
            {
                var video = parent.FindParentOrSelfWithException <Video>();

                com = new DepthStencilStateCom();
                var error = com.Init(video.com, ((DepthStencilStateDesc)desc).com);

                if (error == DepthStencilStateError.DepthStencil)
                {
                    Debug.ThrowError("DepthStencil", "Failed to create DepthStencil");
                }
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }
示例#6
0
 public DepthStencilState(IDisposableResource parent, IDepthStencilStateDesc desc)
     : base(parent)
 {
     this.desc = (DepthStencilStateDesc)desc;
 }