public new void Dispose() { device.Dispose(); deviceContext.Dispose(); renderTarget.Dispose(); swapChain.Dispose(); }
public override void Dispose() { if (m_depthcStencilView != null) { m_depthcStencilView.Dispose(); } if (m_depthBuffer != null) { m_depthBuffer.Dispose(); } if (m_renderTargetView != null) { m_renderTargetView.Dispose(); } if (m_backBuffer != null) { m_backBuffer.Dispose(); } if (m_swapchain != null) { m_swapchain.Dispose(); } if (m_context != null) { m_context.Dispose(); } if (m_device != null) { m_device.Dispose(); } }
internal void InternalRebuildCommandList(GraphicsContext context) { if (m_commandData.Count == 0) { return; } var deferred = new DeviceContext(context.Device); foreach (var cmd in m_commandData) { switch (cmd.Type) { case CommandDataType.ClearRenderTarget: deferred.ClearRenderTargetView(cmd.ParamRTId.GetRawRenderTexture <RenderTargetView>(context), new SharpDX.Color(0, 0, 0, 0)); break; case CommandDataType.Draw: break; } } m_commandList = deferred.FinishCommandList(false); deferred.Dispose(); deferred = null; }
/// <summary> /// Ends a draw operation. /// </summary> public void Dispose() { foreach (var layer in _layerPool) { layer.Dispose(); } try { _deviceContext.EndDraw(); _swapChain?.Present(1, SharpDX.DXGI.PresentFlags.None); _finishedCallback?.Invoke(); } catch (SharpDXException ex) when((uint)ex.HResult == 0x8899000C) // D2DERR_RECREATE_TARGET { throw new RenderTargetCorruptedException(ex); } finally { if (_ownsDeviceContext) { _deviceContext.Dispose(); } } }
public void Dispose() { _swapChain.Dispose(); _device.Dispose(); _deviceContext.Dispose(); _renderTargetView.Dispose(); }
public override void OnEndPrint(PrintDocument document, PrintEventArgs e) { Debug.Assert(dc != null && graphics == null, "PrintController methods called in the wrong order?"); // For security purposes, don't assume our public methods methods are called in any particular order CheckSecurity(document); IntSecurity.UnmanagedCode.Assert(); try { if (dc != null) { try { int result = (e.Cancel) ? SafeNativeMethods.AbortDoc(new HandleRef(dc, dc.Hdc)) : SafeNativeMethods.EndDoc(new HandleRef(dc, dc.Hdc)); if (result <= 0) { throw new Win32Exception(); } } finally { dc.Dispose(); dc = null; } } } finally { CodeAccessPermission.RevertAssert(); } base.OnEndPrint(document, e); }
public void Dispose() { if (StagingTextureOnSaveDevice != null) { StagingTextureOnSaveDevice.Dispose(); StagingTextureOnSaveDevice = null; } if (SharedTextureOnSaveDevice != null) { SharedTextureOnSaveDevice.Dispose(); SharedTextureOnSaveDevice = null; } if (SaveDevice != null) { SaveDeviceContext.Dispose(); SaveDevice.Dispose(); SaveDevice = null; SaveDeviceContext = null; } if (SharedTextureOnRenderDevice != null) { SharedTextureOnRenderDevice.Dispose(); SharedTextureOnRenderDevice = null; } Description = new Texture2DDescription(); SharedDescription = new Texture2DDescription(); }
public void Dispose() { System.Console.WriteLine("Renderer3d.Dispose"); if (context != null) { DiscardDeviceResources(); textureCollection?.Dispose(); textureLoader?.Dispose(); cb_shader_flags?.Dispose(); cb_mat?.Dispose(); cb_wvp?.Dispose(); foreach (NiFile nif in nifs) { foreach (Mesh mesh in nif.meshes) { mesh.Dispose(); } } context.ClearState(); context.Flush(); context.Dispose(); context = null; } skeleton = null; device = null; }
public void Dispose() { ClearAllCommandBuffer(); if (m_depthcStencilView != null) { m_depthcStencilView.Dispose(); } if (m_depthBuffer != null) { m_depthBuffer.Dispose(); } if (m_renderTargetView != null) { m_renderTargetView.Dispose(); } if (m_backBuffer != null) { m_backBuffer.Dispose(); } if (m_swapchain != null) { m_swapchain.Dispose(); } if (m_context != null) { m_context.Dispose(); } if (m_device != null) { m_device.Dispose(); } }
private void Dispose(bool disposing) { if (disposing) { _context.Dispose(); } }
/// <summary> /// Destroy the device context. /// </summary> protected void DestroyDeviceContext() { if (DeviceContext != null) { DeviceContext.Dispose(); DeviceContext = null; } }
public void Dispose() { // General Direct3D 11 stuff m_SwapChainHelper.Dispose(); Device.Dispose(); DeviceContext.Dispose(); rendertargetview_.Dispose(); }
protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
public void Dispose() { BackBufferRTV.Dispose(); BackBuffer.Dispose(); SwapChain.Dispose(); Device.Dispose(); DeviceContext.Dispose(); }
protected virtual void EndPhase1() { mDeviceContext.ClearState(); mDeviceContext.Flush(); mDevice.Dispose(); mDeviceContext.Dispose(); mSwapChain.Dispose(); mFactory.Dispose(); }
public void Dispose() { RenderTargetView.Dispose(); BackBuffer.Dispose(); DeviceContext.Dispose(); D11Device.Dispose(); _swapChain.Dispose(); factory.Dispose(); }
public void Dispose() { renderView.Dispose(); backBuffer.Dispose(); context.ClearState(); context.Flush(); device.Dispose(); context.Dispose(); swapChain.Dispose(); }
public void Dispose() { Keyboard.Unacquire(); Mouse.Unacquire(); graphicsContext.Dispose(); graphicsDevice.Dispose(); swapChain.Dispose(); window.Dispose(); factory.Dispose(); }
public void Dispose() { if (_dc != null) { // Now properly reset GDI. _dc.RestoreHdc(); _dc.Dispose(); _dc = null; } }
public void Dispose() { scene.Dispose(); trackedDeviceBufferManager.Dispose(); deferredContext.Dispose(); passController.Dispose(); masker.Dispose(); viewProjectionTransformBufferManager.Dispose(); }
/// <summary> /// Implements EndPrint for generating print preview information. /// </summary> public override void OnEndPrint(PrintDocument document, PrintEventArgs e) { if (_dc != null) { _dc.Dispose(); _dc = null; } base.OnEndPrint(document, e); }
public void Dispose() { // Release all resources figures.Dispose(); if (ctx != null) { ctx.ClearState(); ctx.Flush(); ctx.Dispose(); } if (il != null) { il.Dispose(); } if (effect != null) { effect.Dispose(); } if (hmd != null) { keyboard.Dispose(); directInput.Dispose(); mtex.Dispose(); layers.Dispose(); eye_texes[0].Dispose(); eye_texes[1].Dispose(); default_rasterizer_state.Dispose(); default_depth_stencil_state.Dispose(); default_blend_state.Dispose(); ztex_view.Dispose(); ztex.Dispose(); buf0_view.Dispose(); buf0.Dispose(); swap_chain.Dispose(); dxgi_factory.Dispose(); // Disposing the device, before the hmd, will cause the hmd to fail when disposing. // Disposing the device, after the hmd, will cause the dispose of the device to fail. // It looks as if the hmd steals ownership of the device and destroys it, when it's shutting down. // device.Dispose(); hmd.Dispose(); } oculus.Dispose(); }
internal static void DisposeDevice() { ForceWindowed(); OnDeviceEnd(); m_initialized = false; if (MyGBuffer.Main != null) { MyGBuffer.Main.Release(); MyGBuffer.Main = null; } if (Backbuffer != null) { Backbuffer.Release(); Backbuffer = null; } if (m_swapchain != null) { m_swapchain.Dispose(); m_swapchain = null; } if (DeviceContext != null) { DeviceContext.Dispose(); DeviceContext = null; } if (Device != null) { #if DEBUG if (VRage.MyCompilationSymbols.DX11Debug) { var deviceDebug = new DeviceDebug(Device); deviceDebug.ReportLiveDeviceObjects(ReportingLevel.Detail | ReportingLevel.Summary); deviceDebug.Dispose(); } #endif Device.Dispose(); Device = null; WIC = null; } if (m_factory != null) { m_factory.Dispose(); m_factory = null; } }
public void Dispose() { if (ctx != null) { ctx.Dispose(); } if (device != null) { device.Dispose(); } }
private void DeviceContext_Create1_Core() { DeviceContext deviceContext = null; // "Windowless" DeviceContext creation should be possible on every platform Assert.DoesNotThrow(() => deviceContext = DeviceContext.Create()); Assert.IsNotNull(deviceContext); // Release resources deviceContext.Dispose(); }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { enabled = false; task.Wait(); device.Dispose(); deviceContext.Dispose(); swapChain.Dispose(); renderTargetView.Dispose(); depthStencilView.Dispose(); }
// Clean up DX public void CleanUpDX() { renderView.Dispose(); backBuffer.Dispose(); devCon.ClearState(); devCon.Flush(); dev.Dispose(); devCon.Dispose(); swapChain.Dispose(); factory.Dispose(); form.Dispose(); }
public void Shutdown() { swapChain.SetFullscreenState(false, null); rasterizerState.Dispose(); depthStencilView.Dispose(); depthStencilState.Dispose(); depthStencilBuffer.Dispose(); renderTargetView.Dispose(); DeviceContext.Dispose(); Device.Dispose(); swapChain.Dispose(); }
public void Dispose() { depthStencilView.Dispose(); depthStencilBuffer.Dispose(); backBuffer.Dispose(); deviceContext.ClearState(); deviceContext.Flush(); deviceContext.Dispose(); device.Dispose(); swapChain.Dispose(); renderTargetView.Dispose(); }
/// <include file='doc\PreviewPrintController.uex' path='docs/doc[@for="PreviewPrintController.OnEndPrint"]/*' /> /// <devdoc> /// <para> /// Implements EndPrint for generating print preview information. /// </para> /// </devdoc> public override void OnEndPrint(PrintDocument document, PrintEventArgs e) { Debug.Assert(dc != null && graphics == null, "PrintController methods called in the wrong order?"); // For security purposes, don't assume our public methods are called in any particular order CheckSecurity(); dc.Dispose(); dc = null; base.OnEndPrint(document, e); }
void ThreadedFunction() { DeviceContext threadContext = null; try { threadContext = new DeviceContext(FContext.Device); var folder = Path.GetDirectoryName(FFilename); if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } (new FileIOPermission(FileIOPermissionAccess.Write, FFilename)).Demand(); Texture2D.SaveTextureToFile(FContext.CurrentDeviceContext, FBackSurface, FFormat, FFilename); } catch (Exception e) { System.Diagnostics.Debug.Print(e.Message); } finally { if (threadContext != null) { threadContext.Dispose(); } CurrentState = State.Available; } }