Пример #1
0
        public void FrameResized(int width, int height)
        {
            lock (device)
            {
                if (textureRGB != null)
                {
                    Utilities.Dispose(ref textureRGB);
                }

                textureRGB = new Texture2D(device, new Texture2DDescription()
                {
                    Usage  = ResourceUsage.Default,
                    Format = Format.R8G8B8A8_UNorm,

                    Width  = width,
                    Height = height,

                    BindFlags      = BindFlags.ShaderResource | BindFlags.RenderTarget,
                    CpuAccessFlags = CpuAccessFlags.None,
                    OptionFlags    = ResourceOptionFlags.None,

                    SampleDescription = new SampleDescription(1, 0),
                    ArraySize         = 1,
                    MipLevels         = 1
                });

                srvRGB = new ShaderResourceView(device, textureRGB);
            }

            if (videoDevice1 == null || videoContext1 == null)
            {
                return;
            }

            Utilities.Dispose(ref vpov);
            videoDevice1.CreateVideoProcessorOutputView((Resource)textureRGB, vpe, vpovd, out vpov);
        }