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