Exemplo n.º 1
0
 private void dispose()
 {
     if (com != null)
     {
         com.Dispose();
         com = null;
     }
 }
Exemplo n.º 2
0
 private void dispose()
 {
     if (com != null)
     {
         com.Dispose();
         com = null;
     }
 }
Exemplo n.º 3
0
        public DepthStencil(IDisposableResource parent, int width, int height, DepthStencilFormats depthStencilFormats)
            : base(parent)
        {
            try
            {
                var video = parent.FindParentOrSelfWithException <Video>();
                Size  = new Size2(width, height);
                SizeF = Size.ToVector2();

                int depthBit = 16, stencilBit = 0;
                switch (depthStencilFormats)
                {
                case DepthStencilFormats.Defualt:
                    depthBit   = 24;
                    stencilBit = 0;
                    break;

                case DepthStencilFormats.Depth24Stencil8:
                    depthBit   = 24;
                    stencilBit = 8;
                    break;

                case DepthStencilFormats.Depth16:
                    depthBit   = 16;
                    stencilBit = 0;
                    break;

                case DepthStencilFormats.Depth24:
                    depthBit   = 24;
                    stencilBit = 0;
                    break;

                case DepthStencilFormats.Depth32:
                    depthBit   = 32;
                    stencilBit = 0;
                    break;

                default:
                    Debug.ThrowError("Video", "Unsuported DepthStencilFormat type");
                    break;
                }

                com = new DepthStencilCom();
                var error = com.Init(video.com, width, height, depthBit, stencilBit);

                switch (error)
                {
                case DepthStencilErrors.Textrue: Debug.ThrowError("DepthStencil", "Failed to create Texture2D"); break;

                case DepthStencilErrors.DepthStencilView: Debug.ThrowError("DepthStencil", "Failed to create DepthStencilView"); break;
                }
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }
Exemplo n.º 4
0
        public DepthStencil(IDisposableResource parent, int width, int height, DepthStencilFormats depthStencilFormats)
            : base(parent)
        {
            try
            {
                var video = parent.FindParentOrSelfWithException<Video>();
                Size = new Size2(width, height);
                SizeF = Size.ToVector2();

                int depthBit = 16, stencilBit = 0;
                switch (depthStencilFormats)
                {
                    case DepthStencilFormats.Defualt:
                        depthBit = 24;
                        stencilBit = 0;
                        break;

                    case DepthStencilFormats.Depth24Stencil8:
                        depthBit = 24;
                        stencilBit = 8;
                        break;

                    case DepthStencilFormats.Depth16:
                        depthBit = 16;
                        stencilBit = 0;
                        break;

                    case DepthStencilFormats.Depth24:
                        depthBit = 24;
                        stencilBit = 0;
                        break;

                    case DepthStencilFormats.Depth32:
                        depthBit = 32;
                        stencilBit = 0;
                        break;

                    default:
                        Debug.ThrowError("Video", "Unsuported DepthStencilFormat type");
                        break;
                }

                com = new DepthStencilCom();
                var error = com.Init(video.com, width, height, depthBit, stencilBit);

                switch (error)
                {
                    case DepthStencilErrors.Textrue: Debug.ThrowError("DepthStencil", "Failed to create Texture2D"); break;
                    case DepthStencilErrors.DepthStencilView: Debug.ThrowError("DepthStencil", "Failed to create DepthStencilView"); break;
                }
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }
Exemplo n.º 5
0
 public override void Dispose()
 {
     disposeChilderen();
     if (com != null)
     {
         com.Dispose();
         com = null;
     }
     base.Dispose();
 }
Exemplo n.º 6
0
        private void init(IDisposableResource parent, int width, int height, DepthStencilFormats depthStencilFormats)
        {
            try
            {
                this.width  = width;
                this.height = height;
                this.depthStencilFormats = depthStencilFormats;

                video = parent.FindParentOrSelfWithException <Video>();
                Size  = new Size2(width, height);
                SizeF = Size.ToVector2();

                int depthBit = 16, stencilBit = 0;
                switch (depthStencilFormats)
                {
                case DepthStencilFormats.Defualt:
                    depthBit   = 24;
                    stencilBit = 0;
                    break;

                case DepthStencilFormats.Depth24Stencil8:
                    depthBit   = 24;
                    stencilBit = 8;
                    break;

                case DepthStencilFormats.Depth16:
                    depthBit   = 16;
                    stencilBit = 0;
                    break;

                case DepthStencilFormats.Depth24:
                    depthBit   = 24;
                    stencilBit = 0;
                    break;

                case DepthStencilFormats.Depth32:
                    depthBit   = 32;
                    stencilBit = 0;
                    break;

                default:
                    Debug.ThrowError("Video", "Unsuported DepthStencilFormat type");
                    break;
                }

                com = new DepthStencilCom();
                var error = com.Init(video.com, width, height, depthBit, stencilBit);

                switch (error)
                {
                case DepthStencilErrors.DepthStencilSurface: Debug.ThrowError("DepthStencil", "Failed to create DepthStencil Surface"); break;
                }

                if (!video.Caps.ExDevice && !video.deviceReseting)
                {
                    video.DeviceLost  += deviceLost;
                    video.DeviceReset += deviceReset;
                }
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }
Exemplo n.º 7
0
 public override void Dispose()
 {
     disposeChilderen();
     if (com != null)
     {
         com.Dispose();
         com = null;
     }
     base.Dispose();
 }
Exemplo n.º 8
0
        private void init(IDisposableResource parent, int width, int height, DepthStencilFormats depthStencilFormats)
        {
            try
            {
                this.width = width;
                this.height = height;
                this.depthStencilFormats = depthStencilFormats;

                video = parent.FindParentOrSelfWithException<Video>();
                Size = new Size2(width, height);
                SizeF = Size.ToVector2();

                int depthBit = 16, stencilBit = 0;
                switch (depthStencilFormats)
                {
                    case DepthStencilFormats.Defualt:
                        depthBit = 24;
                        stencilBit = 0;
                        break;

                    case DepthStencilFormats.Depth24Stencil8:
                        depthBit = 24;
                        stencilBit = 8;
                        break;

                    case DepthStencilFormats.Depth16:
                        depthBit = 16;
                        stencilBit = 0;
                        break;

                    case DepthStencilFormats.Depth24:
                        depthBit = 24;
                        stencilBit = 0;
                        break;

                    case DepthStencilFormats.Depth32:
                        depthBit = 32;
                        stencilBit = 0;
                        break;

                    default:
                        Debug.ThrowError("Video", "Unsuported DepthStencilFormat type");
                        break;
                }

                com = new DepthStencilCom();
                var error = com.Init(video.com, width, height, depthBit, stencilBit);

                switch (error)
                {
                    case DepthStencilErrors.DepthStencilSurface: Debug.ThrowError("DepthStencil", "Failed to create DepthStencil Surface"); break;
                }

                if (!video.Caps.ExDevice && !video.deviceReseting)
                {
                    video.DeviceLost += deviceLost;
                    video.DeviceReset += deviceReset;
                }
            }
            catch (Exception e)
            {
                Dispose();
                throw e;
            }
        }