예제 #1
0
 // performance benchmarks show rendering directly not much slower than VertexArray or VBO)
 // (but we really ought to think about using at least a vertexarray, or ideally a vbo)
 public void Render()
 {
     g.PushMatrix();
     texture1.Apply();
     RenderUnitPart(unit.unitpart);
     g.PopMatrix();
     g.Bind2DTexture(0);
 }
예제 #2
0
        void RenderableAllFeatures_WriteNextFrameEvent(Vector3 camerapos)
        {
            //Console.WriteLine("raf writenextframe");
            GraphicsHelperGl g       = new GraphicsHelperGl();
            FrustrumCulling  culling = FrustrumCulling.GetInstance();

            foreach (FeatureInfo featureinfo in features)
            {
                Vector3 displaypos = new Vector3(featureinfo.x * Terrain.SquareSize, featureinfo.y * Terrain.SquareSize,
                                                 parent.Map[featureinfo.x, featureinfo.y]);
                //  Console.WriteLine("displaypos: " + displaypos );
                if (culling.IsInsideFrustum(displaypos, featureinfo.unit.Radius))
                {
                    //    Console.WriteLine("culling ok");
                    g.PushMatrix();
                    g.Translate(displaypos);
                    featureinfo.unit.Render();
                    g.PopMatrix();
                }
            }
        }