This is the way for VS2010 to use XNA but first u must install VS2008 , XNA 3.1, VS2010 in ur machine.
there are some notes that the main chunk of what you won’t have:
1) You won’t have the content pipeline. If you want to build content, you’ll have to use VS2008 or an external tool.
2) You won’t have deploy for Xbox 360 or Zune. If you want to build an Xbox or Zune game, use VS2008.
Ok,Lets begin:
1) Create a new C# Console Application in VS2010. 
2) Right click your project and choose Add References. 3) Scroll through the list of .NET references to find Microsoft.Xna.Frameworkand Microsoft.Xna.Framework.Game and add those to your project. 
4) Decide whether you want to build for .NET 4.0 (the new CLR) or .NET 2.0/3.0/3.5 (the old CLR). To choose, right click your project and choose Properties. Then change the Target Framework drop down. 5) In your project properties, change the Output Type to Windows Application. 
6) If you’re building against .NET 4.0, you need to add an Application Configuration file to your project. It’s a template in the Add New Item menu for adding files. Be sure to leave the name “App.config”. 
Replace the text in the default file with this:
-
<?xml version="1.0" encoding="utf-8" ?>
-
<configuration>
-
<startup useLegacyV2RuntimeActivationPolicy="true">
-
<supportedRuntime version="v4.0"/>
-
</startup>
-
</configuration>
This lets you use V2 runtime assemblies (like the XNA Framework) in a project compiled against the new CLR.
-
using Microsoft.Xna.Framework;
-
using Microsoft.Xna.Framework.Graphics;
-
-
namespace MyWindowsGame
-
{
-
class Game1 : Game
-
{
-
public Game1()
-
{
-
new GraphicsDeviceManager(this);
-
}
-
-
protected override void Draw(GameTime gameTime)
-
{
-
GraphicsDevice.Clear(Color.CornflowerBlue);
-
base.Draw(gameTime);
-
}
-
-
static void Main(string[] args)
-
{
-
using (Game1 game = new Game1())
-
{
-
game.Run();
-
}
-
}
-
}
-
}
-
您可能会对以下文章感兴趣:
Loading…

Submitting Comment, Give me a second...
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE comment_approved =1 AND comment_author_email !='qzliuyuzou@gmail.com' ' at line 3]
SELECT comment_author,comment_author_email,comment_author_url,count( comment_author_email ) AS cmtcount FROM WHERE comment_approved =1 AND comment_author_email !='qzliuyuzou@gmail.com' AND comment_type = '' AND TO_DAYS( now( ) )-TO_DAYS(`comment_date`)<30 GROUP BY comment_author_email ORDER BY cmtcount DESC LIMIT 0 ,1500全英文啊,看着
[回复]
小鬼
回复:
七月 29th, 2010 at 13:10
@LAONB, 呵呵,直接用Google翻译就好了
[回复]