Example #1
0
 public CompositorInstance(CompositionTechnique technique, CompositorChain chain) : this(OgrePINVOKE.new_CompositorInstance(CompositionTechnique.getCPtr(technique), CompositorChain.getCPtr(chain)), true)
 {
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #2
0
        protected void updateDebugRTTWindow()
        {
            // Clear listbox
            mDebugRTTListbox.resetList();
            // Clear imagesets
            mDebugRTTStaticImage.setImage(null);
            foreach (CeguiDotNet.Imageset imgset in mDebugRTTImageSets)
            {
                CeguiDotNet.ImagesetManager.getSingleton().destroyImageset(imgset);
            }
            mDebugRTTImageSets.Clear();
            // Add an entry for each render texture for all active compositors
            Viewport        vp    = mRenderWindow.GetViewport(0);
            CompositorChain chain = CompositorManager.Instance.getCompositorChain(vp);

            OgreDotNet.CompositorInstancesIteratorWrap it = chain.getCompositors();
            while (it.hasMoreElements())
            {
                CompositorInstance inst = it.getNext();
                if (inst.getEnabled())
                {
                    CTTextureDefinitionsIterator texIt =
                        inst.getTechnique().GetTextureDefinitionIterator();
                    while (texIt.hasMoreElements())
                    {
                        CTTextureDefinition texDef = texIt.getNext();

                        // Get instance name of texture
                        string instName = inst.getTextureInstanceName(texDef.getName());
                        // Create CEGUI texture from name of OGRE texture
                        CeguiDotNet.Texture tex = mGuiRenderer.createTexture(new CeguiDotNet.String(instName));
                        // Create imageset
                        CeguiDotNet.Imageset imgSet =
                            ImagesetManager.getSingleton().createImageset(instName, tex);
                        mDebugRTTImageSets.Add(imgSet);
                        imgSet.defineImage("RttImage",
                                           new CEGUIVector2(0.0f, 0.0f),
                                           new CeguiDotNet.Size(tex.getWidth(), tex.getHeight()),
                                           new CEGUIVector2(0.0f, 0.0f));

                        CeguiDotNet.ListboxTextItem item = new ListboxTextItem(texDef.getName(), 0, Imageset.getCPtr(imgSet).Handle);
                        item.setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");
                        item.setSelectionColours(new CeguiDotNet.colour(0.0f, 0.0f, 1.0f));
                        //the is so we dont have to keep track of the ListboxTextItem
                        //if we loose the reference to the DotNet object CeguiDotNet.ListboxTextItem(leaving scope of the while statement),
                        //The swig generated code will delete the c++ object, we dont want this.
                        //So calling the static function RemoveOwnership will stop the swig generated
                        // code from deleteing the c++ object and the dotnet object can delete normaly.
                        ListboxTextItem.RemoveOwnership(item);
                        //make sure the c++ object will be deleted with its parent
                        item.setAutoDeleted(true);
                        mDebugRTTListbox.addItem(item);
                    }
                }
            }
        }
Example #3
0
        public CompositorChain getCompositorChain(Viewport vp)
        {
            global::System.IntPtr cPtr = OgrePINVOKE.CompositorManager_getCompositorChain(swigCPtr, Viewport.getCPtr(vp));
            CompositorChain       ret  = (cPtr == global::System.IntPtr.Zero) ? null : new CompositorChain(cPtr, false);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #4
0
        public CompositorChain getChain()
        {
            global::System.IntPtr cPtr = OgrePINVOKE.CompositorInstance_getChain(swigCPtr);
            CompositorChain       ret  = (cPtr == global::System.IntPtr.Zero) ? null : new CompositorChain(cPtr, false);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #5
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CompositorChain obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }