Example #1
0
        public BlendState(IDisposableResource parent, IBlendStateDesc desc)
            : base(parent)
        {
            var video = parent.FindParentOrSelfWithException <Video>();

            com = new BlendStateCom(video.com, ((BlendStateDesc)desc).com);
        }
Example #2
0
        public static IBlendStateDesc New(VideoTypes videoType, BlendStateTypes type)
        {
            IBlendStateDesc api = null;

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

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

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

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

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

            if (api == null)
            {
                Debug.ThrowError("BlendStateDescAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Example #3
0
        public BlendState(IDisposableResource parent, IBlendStateDesc desc)
            : base(parent)
        {
            try
            {
                var video = parent.FindParentOrSelfWithException<Video>();

                com = new BlendStateCom();
                var error = com.Init(video.com, ((BlendStateDesc)desc).com);

                if (error == BlendStateError.BlendState) Debug.ThrowError("BlendState", "Failed to create BlendState");
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }
Example #4
0
        public BlendState(IDisposableResource parent, IBlendStateDesc desc)
            : base(parent)
        {
            try
            {
                var video = parent.FindParentOrSelfWithException <Video>();

                com = new BlendStateCom();
                var error = com.Init(video.com, ((BlendStateDesc)desc).com);

                if (error == BlendStateError.BlendState)
                {
                    Debug.ThrowError("BlendState", "Failed to create BlendState");
                }
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }
Example #5
0
        public static IBlendState New(VideoTypes videoType, IDisposableResource parent, IBlendStateDesc desc)
        {
            IBlendState api = null;

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

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

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

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

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

            if (api == null)
            {
                Debug.ThrowError("BlendStateAPI", "Unsuported InputType: " + videoType);
            }
            return(api);
        }
Example #6
0
 public BlendState(IDisposableResource parent, IBlendStateDesc desc)
     : base(parent)
 {
     this.desc = (BlendStateDesc)desc;
 }
Example #7
0
 public BlendState(IDisposableResource parent, IBlendStateDesc desc)
     : base(parent)
 {
     this.desc = (BlendStateDesc)desc;
 }