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; }
/// <summary> /// Disposes members that need it /// </summary> public void EditorForm_Dispose(object sender, EventArgs e) { TextureCollection.Dispose(); }