0

IsFixedTimeStep と TargetElapsedTime で遊んでいますが、30 fps を超える fps を取得できません。これは、エミュレーターと私の HTC HD7 電話の両方にあります。

Farseer でも World.Step() 設定を正しく取得しようとしていますが、これに適した設定が見つかりませんでした。

60fps で実行したい場合、3 つの設定 (IsFixedTimeStep、TargetElapsedTime、World.Step) はどのように設定するのが理想的ですか?

ありがとう!

4

1 に答える 1

2

Mango Deployed アプリを実行している限り、ゲームを 60fps で実行できます。

以下のコードはMSDN: Game at 60fpsから引用されたものです。

60Hzで実行されるゲームタイマー間隔

timer.UpdateInterval = TimeSpan.FromTicks(166667);

イベント ハンドラーを作成する

    public Game1()
    {
       graphics = new GraphicsDeviceManager(this);

       graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);

       // Frame rate is 60 fps
       TargetElapsedTime = TimeSpan.FromTicks(166667);
    }

次に、ハンドラーを実装します

void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
   e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval = PresentInterval.One;
}
于 2012-03-16T09:46:06.807 に答える