コード例 #1
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            _controller.Update(this, (float)e.Time);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            UpdateText();
            UpdateUI();
            Test.Render();
            if (DebugDrawer.ShowUI)
            {
                DebugDrawer.DrawString(5, Global.Camera.Height - 60, $"steps: {Test.StepCount}");
                DebugDrawer.DrawString(5, Global.Camera.Height - 40, $"{_frameTime / 10000f:.#} ms");
                DebugDrawer.DrawString(5, Global.Camera.Height - 20, $"{GetFps(_frameTime / 10000f)} fps");
            }

            DebugDrawer.Flush();

            _controller.Render();

            Util.CheckGLError("End of frame");
            SwapBuffers();
            base.OnRenderFrame(e);
        }