示例#1
0
        /// <summary>
        /// Add a viewport to the rendering target.
        /// </summary>
        /// <remarks>
        /// A viewport is the rectangle into which rendering output is sent. This
        /// method adds a viewport to the render target, rendering from the supplied
        /// camera. The rest of the parameters are only required if you wish to add
        /// more than one viewport to a single rendering target. Note that size
        /// information passed to this method is passed as a parametric, i.e. it is
        /// relative rather than absolute. This is to allow viewports to
        /// automatically resize along with the target.
        /// </remarks>
        /// <param name="camera">The camera to use for the viewport.</param>
        /// <returns>A new viewport.</returns>
        public Viewport addViewport(Camera camera)
        {
            Viewport vp = ViewportManager.getViewport(RenderTarget_addViewport(renderTarget, camera.OgreObject));

            viewports.Add(vp);
            return(vp);
        }
示例#2
0
        /// <summary>
        /// Add a viewport to the rendering target.
        /// </summary>
        /// <remarks>
        /// A viewport is the rectangle into which rendering output is sent. This
        /// method adds a viewport to the render target, rendering from the supplied
        /// camera. The rest of the parameters are only required if you wish to add
        /// more than one viewport to a single rendering target. Note that size
        /// information passed to this method is passed as a parametric, i.e. it is
        /// relative rather than absolute. This is to allow viewports to
        /// automatically resize along with the target.
        /// </remarks>
        /// <param name="camera">The camera to use for the viewport.</param>
        /// <param name="zOrder">The relative order of the viewport with others on the target (allows overlapping viewports i.e. picture-in-picture). Higher ZOrders are on top of lower ones. The actual number is irrelevant, only the relative ZOrder matters (you can leave gaps in the numbering).</param>
        /// <param name="left">The relative position of the left of the viewport on the target, as a value between 0 and 1. </param>
        /// <param name="top">The relative position of the top of the viewport on the target, as a value between 0 and 1. </param>
        /// <param name="width">The relative width of the viewport on the target, as a value between 0 and 1. </param>
        /// <param name="height">The relative height of the viewport on the target, as a value between 0 and 1.</param>
        /// <returns>A new viewport.</returns>
        public Viewport addViewport(Camera camera, int zOrder, float left, float top, float width, float height)
        {
            Viewport vp = ViewportManager.getViewport(RenderTarget_addViewportExt(renderTarget, camera.OgreObject, zOrder, left, top, width, height));

            viewports.Add(vp);
            return(vp);
        }
        /// <summary>
        /// Called after searching for visible objects in this SceneManager.
        /// Note that the render queue at this stage will be full of the current scenes contents,
        /// ready for rendering. You may manually add renderables to this queue if you wish.
        /// </summary>
        /// <param name="sceneManager">The SceneManager instance raising this event.</param>
        /// <param name="irs">The stage of illumination being dealt with. IRS_NONE for a regular
        /// render, IRS_RENDER_TO_TEXTURE for a shadow caster render.</param>
        /// <param name="viewport">The viewport being updated.</param>
        void postFindVisibleObjects(IntPtr sceneManager, SceneManager.IlluminationRenderStage irs, IntPtr viewport)
        {
            Viewport vp = ViewportManager.getViewportNoCreate(viewport);

            foreach (SceneListener listener in sceneListeners)
            {
                listener.postFindVisibleObjects(this.sceneManager, irs, vp);
            }
        }
示例#4
0
 public void Dispose()
 {
     checkDestroyListener(true);
     foreach (Viewport vp in viewports)
     {
         ViewportManager.destroyViewport(vp);
     }
     viewports.Clear();
     renderTarget = IntPtr.Zero;
 }
示例#5
0
 public Viewport getCurrentViewport()
 {
     return(ViewportManager.getViewportNoCreate(SceneManager_getCurrentViewport(ogreSceneManager)));
 }
示例#6
0
 /// <summary>
 /// Get the viewport identified by name.
 /// </summary>
 /// <param name="index">The index of the viewport to get.</param>
 /// <returns>The viewport identified by name or null if it is not found.</returns>
 public Viewport getViewport(ushort index)
 {
     return(ViewportManager.getViewport(RenderTarget_getViewport(renderTarget, index)));
 }
示例#7
0
 /// <summary>
 /// This will destroy the passed viewport.
 /// </summary>
 public void destroyViewport(Viewport viewport)
 {
     viewports.Remove(viewport);
     RenderTarget_destroyViewport(renderTarget, ViewportManager.destroyViewport(viewport));
 }