Exemple #1
0
 public static void DisposeAllModels()
 {
     foreach (var m in remoModelDict)
     {
         m.Value?.Dispose();
     }
     remoModelDict?.Clear();
     Scene.ClearScene();
     TexturePool.Flush();
     remoModelDict = new Dictionary <string, Model>();
 }
Exemple #2
0
        public static void ClearScene()
        {
            lock (_lock_ModelLoad_Draw)
            {
                foreach (var mi in Models)
                {
                    mi.Dispose();
                }

                TexturePool.Flush();
                Models?.Clear();
                GC.Collect();
            }
        }
Exemple #3
0
        public static void ClearSceneAndAddModel(Model m)
        {
            lock (_lock_ModelLoad_Draw)
            {
                foreach (var mi in Models)
                {
                    if (mi == m)
                    {
                        continue;
                    }
                    mi.Dispose();
                }

                TexturePool.Flush();
                Models?.Clear();
                GC.Collect();

                Models.Add(m);
            }
        }