WP7上的表现XNA [英] XNA performance on WP7

查看:90
本文介绍了WP7上的表现XNA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我的WP7 XNA游戏的帧速率可达60帧。它出现在约30fps的标志被锁定。我试过的变化,但差别不大。

I'm trying to get the frame rate of my XNA game on WP7 up to 60 fps. It appears to be locked at around the 30fps mark. I've tried the change of but makes little difference.

PresentationParameters.PresentationInterval = PresentInterval.One

有什么想法?

推荐答案

您可以更改固定时间步长的XNA默认为:

You can change the fixed time step that XNA defaults to:

// 166666 ticks is 16.6ms, which is 60hz
game.TargetElapsedTime = new TimeSpan(166666)  // 'game' refers to your instance of XNA.Game 



实例

下面是对功能文档:
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.targetelapsedtime.aspx

或者,如果你只是想关掉固定的时间步长,尽量固定时间步长设置为false:

Or, if you just want to turn off the fixed timestep, try setting fixed time step to false:

game.IsFixedTimeStep = false   // 'game' refers to your instance of XNA.Game

下面是对功能文档实例:
< A HREF =htt​​p://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.isfixedtimestep.aspx相对=nofollow> http://msdn.microsoft.com/en-美国/库/ microsoft.xna.framework.game.isfixedtimestep.aspx

Here's documentation on the feature: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.isfixedtimestep.aspx

这是在XNA设置为true默认情况下,所以你会看到一个固定的时间步骤,直到将其除外。

This is set to true by default in XNA, so you will see a fixed time-step until you set it otherwise.

当然也有那的性能问题保持你周围每秒30帧的机会。你可能会看到垂直同步举行了框架与手机的显示屏同步,无论是显示可能会限制为30 fps(不太可能),或者如果你的游戏比每帧16.6ms服用时间越长,V-SYNC可以无论是抱着为30 fps与显示器保持同步。在30 FPS游戏会使每隔一帧的显示刷新。但是,如果垂直同步被停用,你的游戏是在像50帧每秒,你的游戏将只能部分地完成了实时渲染的显示刷新,你最终用的画面撕裂

Of course there is also the chance that performance problems are keeping you around 30 fps. You could be seeing V-sync holding up the frame to sync with the phone's display, either the display may be limited to 30 fps (not likely), or if your game is taking longer than 16.6ms per frame, the V-sync might be holding it to 30 fps to keep it in sync with the display. At 30 fps your game would render every other frame that the display refreshes. But if V-sync was disabled and your game was running at something like 50 fps, your game would only partially be done rendering by the time the display refreshed, and you'd end up with screen tearing.

这篇关于WP7上的表现XNA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆