Esempio n. 1
0
        public CaptureFrameWait(IDirect3DDevice device, Func <GraphicsCaptureItem> itemFactory)
        {
            this.device      = device;
            this.d3dDevice   = Direct3D11Helper.CreateSharpDXDevice(device);
            this.multithread = d3dDevice.QueryInterface <SharpDX.Direct3D11.Multithread>();
            this.multithread.SetMultithreadProtected(true);
            this.frameEvent  = new ManualResetEvent(false);
            this.closedEvent = new ManualResetEvent(false);
            this.events      = new[] { closedEvent, frameEvent };
            this.itemFactory = itemFactory;
            this.CurrentItem = this.itemFactory();

            InitializeBlankTexture(this.CurrentItem.Size);
            InitializeCapture();
        }
Esempio n. 2
0
 public MultithreadLock(SharpDX.Direct3D11.Multithread multithread)
 {
     _multithread = multithread;
     _multithread?.Enter();
 }
Esempio n. 3
0
 public void Dispose()
 {
     this.multithread?.Leave();
     this.multithread = null;
 }