私はWindows XP SP3を持っています。XNA 3.1遅い動き
私は、バージョン3.1のデフォルトのXNAのプロジェクトを作成し、事前生成コードにこれらのシンプルなラインを追加しました:このような単純な
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Rectangle rectangle = new Rectangle(80, 80, 100, 100);
Texture2D textureTrain;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
//TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 10);
}
...
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: use this.Content to load your game content here
textureTrain = Content.Load<Texture2D>("MyBitmap1");
}
...
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
// TODO: Add your update logic here
rectangle.X = rectangle.X + 1;
rectangle.Y = rectangle.Y + 1;
base.Update(gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
spriteBatch.Begin();
spriteBatch.Draw(textureTrain, rectangle, Color.White);
spriteBatch.End();
base.Draw(gameTime);
}
}
を!しかし、動きは非常に遅いです、それはちらつき、私はそれを見ることもできません。 私はそれをいくつかのフラッシュゲームと比較すると比類のないものです。どうしてこれなの?私は間違って何をしていますか?
XNA 4.0がしばらく出てきて、あなたが今使用してしなければならないものですしている注意してください。 –
私はあなたのコードをテストしましたが(XNA 4のVistaでも)、どんな種類のちらつきや吃音も遅れもありませんでした(そして、XPとXNA 3.1のどちらにもないと思います)。あなたは、GPUで加速されたゲームを通常、ラグフリーでプレイすることができますか?投稿していないコードはありますか? –
XPとVistaの間でXNAを実行しているのと後で違いがないことは間違いありませんか?私はこのPC上でゲームをプレイしたことはありません..はい、それは投稿された完全なコードです。私はGPUにアクセスするためにいくつかのドライバ/ライブラリが欠けている可能性がありますか?とにかく、このような単純な例は、CPUによって円滑にエミュレートされる必要がありますか、間違っていますか? –