简体   繁体   中英

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!

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;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM