SDL.NET坏帧率

时间:2011-05-13 20:25:35

标签: sdl frame-rate sdl.net

使用此SDL.NET代码,我获得63 fps。为什么?你可以看到我只做一次填充。

    void OnTick(object sender, TickEventArgs args)
    {
        if (firstTick)
        {
            firstTick = false;
            return;
        }
        if (!lastEsc && Keyboard.IsKeyPressed(Key.Escape))
        {
            Events.QuitApplication();
        }

        lastEsc = Keyboard.IsKeyPressed(Key.Escape);            
        surface.Fill(battle_field, Color.DarkOliveGreen);

        myelapse += args.TicksElapsed;
        while(myelapse>=1000){
            myelapse-= 100;
            Console.WriteLine(args.Fps);
        }

        surface.Update();
    }

0 个答案:

没有答案