使用此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();
}