Exemple #1
0
        public override void Dispose()
        {
            foreach (CeguiDotNet.Imageset imgset in mDebugRTTImageSets)
            {
                CeguiDotNet.ImagesetManager.getSingleton().destroyImageset(imgset);
            }
            mDebugRTTImageSets.Clear();
            mDebugRTTImageSets = null;


            mMainNode = null;
            mSpinny   = null;
            mhvListener.Dispose();
            mhvListener = null;
            mhdrListener.Dispose();
            mhdrListener = null;
            mCompositorSelectorViewManager = null;


            mGuiAvg            = null;
            mGuiCurr           = null;
            mGuiBest           = null;
            mGuiWorst          = null;
            mGuiTris           = null;
            mGuiDbg            = null;
            mGuiRoot           = null;
            mDebugRTTListbox   = null;
            mDebugRTTImageSets = null;



            if (WindowManager.Instance != null)
            {
                WindowManager.Instance.destroyAllWindows();
            }
            if (mGuiSystem != null)
            {
                mGuiSystem.Dispose();
            }
            mGuiSystem = null;
            if (mGuiRenderer != null)
            {
                mGuiRenderer.Dispose();
            }
            mGuiRenderer = null;

            if (mLog != null)
            {
                mLog.Dispose();
            }
            mLog = null;

            base.Dispose();
        }
Exemple #2
0
        protected void registerCompositors()
        {
            Viewport vp = mRenderWindow.GetViewport(0);

            mhvListener  = new HeatVisionListener();
            mhdrListener = new HDRListener();

            mCompositorSelectorViewManager = new ItemSelectorViewManager("CompositorSelectorWin");
            // tell view manager to notify us when an item changes selection state
            mCompositorSelectorViewManager.EventItemStateChanged += new ISVMItemStateChanged(ItemStateChanged);
            //iterate through Compositor Managers resources and add name keys ast Item selectors to Compositor selector view manager
            OgreDotNet.ResourceMapIteratorWrap resourceIterator =
                CompositorManager.Instance.GetAsResourceManager().getResourceIterator();

            // add all compositor resources to the view container
            while (resourceIterator.hasMoreElements())
            {
                ResourcePtr resource       = resourceIterator.getNext();
                string      compositorName = resource.GetName();
                // Don't add base Ogre/Scene compositor to view
                if (compositorName == "Ogre/Scene")
                {
                    continue;
                }

                mCompositorSelectorViewManager.addItemSelector(compositorName);
                int addPosition = -1;
                if (compositorName == "HDR")
                {
                    // HDR must be first in the chain
                    addPosition = 0;
                }
                CompositorInstance instance = CompositorManager.Instance.addCompositor(vp, compositorName, addPosition);
                CompositorManager.Instance.setCompositorEnabled(vp, compositorName, false);
                // special handling for Heat Vision which uses a listener
                if ((instance != null) && (compositorName == "Heat Vision"))
                {
                    instance.AddListener(mhvListener);
                }
                else if ((instance != null) && (compositorName == "HDR"))
                {
                    instance.AddListener(mhdrListener);
                    mhdrListener.notifyViewportSize(vp.GetActualWidth(), vp.GetActualHeight());
                    mhdrListener.notifyCompositor(instance);
                }
            }
        }