当前位置: 首页>>代码示例>>C#>>正文


C# IRenderable.Render方法代码示例

本文整理汇总了C#中IRenderable.Render方法的典型用法代码示例。如果您正苦于以下问题:C# IRenderable.Render方法的具体用法?C# IRenderable.Render怎么用?C# IRenderable.Render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRenderable的用法示例。


在下文中一共展示了IRenderable.Render方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Render

 public static string Render(IRenderable renderable)
 {
     var memoryStream = new MemoryStream();
     var streamWriter = new StreamWriter(memoryStream, Encoding.UTF8);
     streamWriter.AutoFlush = true;
     renderable.Render(streamWriter);
     memoryStream.Seek(0, SeekOrigin.Begin);
     return new StreamReader(memoryStream, Encoding.UTF8).ReadToEnd();
 }
开发者ID:fmedio,项目名称:Peach,代码行数:9,代码来源:TagTest.cs

示例2: Apply

        /// <summary>
        /// Applies this technique. Applies a pass, then invokes the render delegate to render stuff, for each pass
        /// </summary>
        /// <param name="context">Rendering context</param>
        /// <param name="renderable">Object to render</param>
        public override void Apply( IRenderContext context, IRenderable renderable )
        {
            Begin( );

            if ( m_Passes.Count > 0 )
            {
                foreach ( IPass pass in m_Passes )
                {
                    pass.Begin( );
                    renderable.Render( context );
                    pass.End( );
                }
            }
            else
            {
                renderable.Render( context );
            }

            End( );
        }
开发者ID:johann-gambolputty,项目名称:robotbastards,代码行数:25,代码来源:MultiPassTechnique.cs

示例3: CreatePolygon

        /// <summary>
        /// This is the main function of the class, it'll create a triangulated polygon
        /// from and SceneObject.
        /// </summary>
        /// <param name="gl">The gl.</param>
        /// <param name="sourceObject">The object to convert.</param>
        /// <param name="guarenteedView">A camera that can see the whole object.</param>
        /// <returns>
        /// A polygon created from 'sourceObject'.
        /// </returns>
        public Polygon CreatePolygon(OpenGL gl, IRenderable sourceObject, Camera guarenteedView)
        {
            //	Save the current camera data.
            gl.MatrixMode(OpenGL.GL_PROJECTION);
            gl.PushMatrix();

            //	Look through the camera that can see the object.
            guarenteedView.Project(gl);

            //	Start triangulation.
            Begin(gl);

            //	Draw the object.
            sourceObject.Render(gl, RenderMode.Design);

            //	End triangulation.
            End(gl);

            Polygon newPoly = Triangle;
            newPoly.Name = (sourceObject is SceneElement ? ((SceneElement)sourceObject).Name : "Object") + " (Triangulated Poly)";
            return newPoly;
        }
开发者ID:cvanherk,项目名称:3d-engine,代码行数:32,代码来源:Polygonator.cs

示例4: Freeze

        /// <summary>
        /// Freezes the specified instance.
        /// </summary>
        /// <param name="gl">The gl instance.</param>
        /// <param name="renderable">The renderable.</param>
        public void Freeze(OpenGL gl, IRenderable renderable)
        {
            //  Handle the trivial case.
            if (isFrozen)
                return;

            //  Create the display list.
            if (displayList != null)
                displayList.Delete(gl);
            displayList = new DisplayList();
            displayList.Generate(gl);

            //  Start the display list.
            displayList.New(gl, DisplayList.DisplayListMode.Compile);

            //  Render the object.
            renderable.Render(gl, RenderMode.Design);

            //  End the display list.
            displayList.End(gl);

            //  We are now frozen.
            isFrozen = true;
        }
开发者ID:hhool,项目名称:sharpgl,代码行数:29,代码来源:FreezableHelper.cs

示例5: Apply

 /// <summary>
 /// Renders the specified object
 /// </summary>
 /// <param name="context">Rendering context</param>
 /// <param name="renderable">Object to render</param>
 public override void Apply( IRenderContext context, IRenderable renderable )
 {
     SetupTerrainEffect( m_Effect, m_Planet );
     renderable.Render( context );
 }
开发者ID:johann-gambolputty,项目名称:robotbastards,代码行数:10,代码来源:PlanetPackTextureTechnique.cs

示例6: Render

 public void Render(IRenderable entity, GameTime gameTime)
 {
     entity.Render(this, gameTime);
 }
开发者ID:DigitalLibrarian,项目名称:xna-forever,代码行数:4,代码来源:RenderContext.cs

示例7: GetClickedHitTarget

        // dependencies:
        // - RendererFactory.GetInstance()
        // - Tao.OpenGl
        public HitTarget GetClickedHitTarget( IRenderable renderable, int MouseX, int MouseY )
        {
            GraphicsHelperGl g = new GraphicsHelperGl();
            g.CheckError();

            IRenderer renderer = RendererFactory.GetInstance();
            ArrayList results = new ArrayList();

            int[] viewport = new int[ 4 ];
            Gl.glGetIntegerv( Gl.GL_VIEWPORT, viewport );
            g.CheckError();
            CreateSelectBuffer();
            g.CheckError();

            // This Creates A Matrix That Will Zoom Up To A Small Portion Of The Screen, Where The Mouse Is.
            Gl.glMatrixMode( Gl.GL_PROJECTION );
            g.CheckError();
            Gl.glPushMatrix();   // save old matrix, we restore it at end
            g.CheckError();
            Gl.glLoadIdentity();
            g.CheckError();
            Glu.gluPickMatrix( (float)MouseX, (float)(renderer.WindowHeight - MouseY), 1.0f, 1.0f, viewport );
            g.CheckError();
            Glu.gluPerspective( renderer.FieldOfView, (float)renderer.WindowWidth / (float)renderer.WindowHeight, renderer.NearClip, renderer.FarClip );
            g.CheckError();

            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            g.CheckError();

            Gl.glRenderMode( Gl.GL_SELECT );
            g.CheckError();
            Gl.glInitNames();
            g.CheckError();
            Gl.glPushName( 0 );            // Push one entry onto the stack; we will use LoadName to change this value throughout the rendering

            g.CheckError();
            bAddingNames = true;
            hittargets = new ArrayList();
            renderable.Render();
            bAddingNames = false;

            // return projection matrix to normal
            Gl.glMatrixMode( Gl.GL_PROJECTION );
            Gl.glPopMatrix();
            Gl.glMatrixMode( Gl.GL_MODELVIEW );

            int iNumHits = Gl.glRenderMode( Gl.GL_RENDER );

            int hitname = GetNearestBufferName( iNumHits );
            LogFile.WriteLine( "hitname: " + hitname.ToString() );
            if( hitname == -1 || hitname == 0 )
            {
                LogFile.WriteLine("not in buffer");
                return null;
            }

            FreeSelectBuffer();
            new GraphicsHelperGl().CheckError();

            if (hittargets.Count == 0)
            {
                return null;
            }

            if (iNumHits == 0)
            {
                //LogFile.WriteLine("no hits");
                return null;
            }

            //LogFile.WriteLine(hittargets[hitname - 1]);
            return (HitTarget)hittargets[ hitname - 1 ];
        }
开发者ID:hughperkins,项目名称:osmp-cs,代码行数:76,代码来源:Picker3dModelGl.cs

示例8: ApplyTechnique

        /// <summary>
        /// Renders a renderable object using a given technique
        /// </summary>
        public void ApplyTechnique( ITechnique technique, IRenderable renderable )
        {
            if ( renderable == null )
            {
                return;
            }

            if ( GlobalTechnique != null )
            {
                if ( technique != null )
                {
                    if ( technique.Effect != null )
                    {
                        //  GlobalTechnique and technique exist. technique is part of an effect group. Apply a substitute to GlobalTechnique
                        technique.Effect.SubstituteTechnique( GlobalTechnique ).Apply( this, renderable );
                    }
                    else if ( technique.IsSubstituteFor( GlobalTechnique ) )
                    {
                        //  GlobalTechnique and technique exist. technique is a substitute for GlobalTechnique. Apply technique
                        technique.Apply( this, renderable );
                    }
                    else
                    {
                        //  GlobalTechnique and technique exist. technique is not a substitute for GlobalTechnique. Apply GlobalTechnique
                        GlobalTechnique.Apply( this, renderable );
                    }
                }
                else
                {
                    //  GlobalTechnique exists, technique was null. Apply GlobalTechnique
                    GlobalTechnique.Apply( this, renderable );
                }
            }
            else if ( technique != null )
            {
                //  GlobalTechnique doesn't exist, technique does. Apply technique
                technique.Apply( this, renderable );
            }
            else
            {
                //  Neither GlobalTechnique or technique exist. Render object directly
                renderable.Render( this );
            }
        }
开发者ID:johann-gambolputty,项目名称:robotbastards,代码行数:47,代码来源:RenderContext.cs

示例9: Run

        /// <summary>
        /// Runs this node
        /// </summary>
        /// <param name="context">Rendering context</param>
        /// <param name="renderable">Renderable object</param>
        public virtual void Run( IRenderContext context, IRenderable renderable )
        {
            if ( renderable == null )
            {
                return;
            }

            //	Update all bindings
            foreach ( Binding binding in m_Bindings )
            {
                binding.Update( );
            }

            //	Render the object
            renderable.Render( context );
        }
开发者ID:johann-gambolputty,项目名称:robotbastards,代码行数:21,代码来源:RenderNode.cs

示例10: Apply

 /// <summary>
 /// Applies the selected technique (<see cref="ITechnique.Apply(IRenderContext, IRenderable)"/>) to render the specified object
 /// </summary>
 /// <param name="context">Rendering context</param>
 /// <param name="renderable">Object to render</param>
 public void Apply( IRenderContext context, IRenderable renderable )
 {
     if ( m_Technique != null )
     {
         m_Technique.Apply( context, renderable );
     }
     else
     {
         renderable.Render( context );
     }
 }
开发者ID:johann-gambolputty,项目名称:robotbastards,代码行数:16,代码来源:TechniqueSelector.cs


注:本文中的IRenderable.Render方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。