public void Dispose() { var ogreSubsystem = engineResourceManager.getSubsystemResource("Ogre"); ogreSubsystem.removeResourceGroup("Internal"); engineResourceManager.initializeResources(); if (OgreConfig.SaveMicrocodeCache && GpuProgramManager.Instance.IsCacheDirty && MicrocodeCachePath != null) { try { using (Stream stream = File.Open(MicrocodeCachePath, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite, System.IO.FileShare.Read)) { GpuProgramManager.Instance.saveMicrocodeCache(stream); Log.Info("Saved microcode cache {0}", MicrocodeCachePath); } } catch (Exception ex) { Log.Error("{0} saving microcode cache {1}.\nReason:{2}", ex.GetType().Name, MicrocodeCachePath, ex.Message); } } OgreInterface_DestroyVaryingCompressedTextures(); GpuProgramManager.Instance.Dispose(); HighLevelGpuProgramManager.Instance.Dispose(); MaterialManager.getInstance().Dispose(); MeshManager.getInstance().Dispose(); SkeletonManager.getInstance().Dispose(); HardwareBufferManager.getInstance().Dispose(); TextureManager.getInstance().Dispose(); OgreDataStream.DisposeSharedPtrs(); destroyRendererWindow(primaryWindow); root.Dispose(); OgreInterface_UnloadRenderSystem(renderSystemPlugin); if (deviceLostListener != null) { deviceLostListener.Dispose(); } if (Disposed != null) { Disposed.Invoke(this); } }
/// <summary> /// Gets the Mesh that this Entity is based on. /// </summary> /// <returns>The mesh for this entity.</returns> public MeshPtr getMesh() { MeshManager meshManager = MeshManager.getInstance(); return(meshManager.getObject(Entity_getMesh(ogreObject, meshManager.ProcessWrapperObjectCallback))); }
public MeshPtr clone(String newName, String newGroup) { MeshManager meshManager = MeshManager.getInstance(); return(meshManager.getObject(Mesh_cloneChangeGroup(resource, newName, newGroup, meshManager.ProcessWrapperObjectCallback))); }