Simon Jefferies
Simon Jefferies

Reputation: 415

XNA performance and setup on WP7

I've been playing around with IsFixedTimeStep and TargetElapsedTime but I'm unable to get an fps above the 30fps. This is in both the emulator and on my HTC HD7 phone.

I'm trying to get the World.Step() setting correct in Farseer too, but havent found a good setting for this.

If I want to get it running at 60fps what should the three settings (IsFixedTimeStep, TargetElapsedTime and World.Step) ideally be?

Thanks!

Upvotes: 0

Views: 212

Answers (1)

ry8806
ry8806

Reputation: 2348

You can make your game run at 60fps as long as you are running a Mango Deployed App

the code below was lifted from: MSDN: Game at 60fps

game timer interval run at 60Hz

timer.UpdateInterval = TimeSpan.FromTicks(166667);

Create the event handler

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

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

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

Then implement the handler

void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
   e.GraphicsDeviceInformation.PresentationParameters.PresentationInterval = PresentInterval.One;
}

Upvotes: 2

Related Questions