示例#1
0
        public OgreDataStreamPtr openResource(String resourceName, String groupName, bool searchGroupsIfNotFound)
        {
            IntPtr ptr = ResourceGroupManager_openResource(resourceName, groupName, searchGroupsIfNotFound, OgreDataStream.ProcessWrapperObjectCallback);

            OgreExceptionManager.fireAnyException();
            return(OgreDataStream.getObject(ptr));
        }
示例#2
0
        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);
            }
        }