Beispiel #1
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);
            GL.Clear(ClearBufferMask.ColorBufferBit);

            var xx = sw.ElapsedTicks;

            switch (Config.screen)
            {
            case Screen.Stage:
                Stage.Draw(Audio.MusicTime);
                Judgement.Draw(Audio.MusicTime);
                break;

            case Screen.SongSelection:
                if (Stage.beatmap != null)
                {
                    Stage.Draw(Audio.MusicTime);
                }
                SongSelection.Draw();
                break;
            }
            var yy = sw.ElapsedTicks;

            SwapBuffers();
            var zz = sw.ElapsedTicks;

            frameTime     = e.Time * 1000;
            drawTime      = (yy - xx) * 1000 / (double)Stopwatch.Frequency;
            times[tIndex] = frameTime;
            if (++tIndex == 1024)
            {
                tIndex = 0;
            }
        }