Ejemplo n.º 1
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);

            //Debug.Trace("update");

            // reset polygon count
            polyCount = 0;

            GL.Color3(255, 255, 255);
            //GL.ClearColor(0.2f, 0.2f, 0.8f, 0.0f);
            GL.ClearColor(1.0f, 1.0f, 1.0f, 1.0f);
            //GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            GL.MatrixMode(MatrixMode.Modelview);

            camera.Update();
            GL.LoadIdentity();
            camera.Look();
            frustum.CalculateFrustum();

            for (int i = 0; i < maxCubes; i++)
            {
                //cube[i].render(ref frustum);
            }

            earth.Render(ref frustum);

            // font.drawString(5, 1.5f, "Hello World\nI am glad to meet you.", .01f, .01f, TrueTypeFont.ALIGN_LEFT);

            Title = String.Format("FPS={0:0}", Core.Fps.Get(e.Time)) + String.Format(" Polygons rendered={0:0}", polyCount);

            //GL.Flush();
            SwapBuffers();
        }