我开始学习XNA并顺利进行。但是,我不知道我是否通过学习3.1而不是4.0来开始自己的脚步?学习XNA 3.1对XNA 4.0
我知道什么是新的:http://msdn.microsoft.com/en-us/library/bb417503.aspx,这大多数似乎是手机,接口和视频功能 - 我不太感兴趣 - 我更多的是做核心3D的东西。
问题的关键是:我已经有Visual Studio 2008专业版了,如果在4.0版游戏编程中没有什么区别,我不想得到VS 2010。
世界是否在继续?我在3.1中学到的东西是否会变得冗余?
也有在库中的代码不同,但它们不是主要的,很多都可以在这里看到:http://www.nelxon.com/blog/xna-3-1-to-xna-4-0-cheatsheet/,比如这一次,我必须想出比Riemers啧:
XNA 4.0
protected override void Draw(GameTime gameTime)
{
device.Clear(Color.DarkSlateBlue);
RasterizerState rs = new RasterizerState();
rs.CullMode = CullMode.None;
device.RasterizerState = rs;
effect.CurrentTechnique = effect.Techniques["ColoredNoShading"];
effect.Parameters["xView"].SetValue(viewMatrix);
effect.Parameters["xProjection"].SetValue(projectionMatrix);
effect.Parameters["xWorld"].SetValue(Matrix.Identity);
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Apply();
device.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 1, VertexPositionColor.VertexDeclaration);
}
base.Draw(gameTime);
}
XNA 3.1
protected override void Draw(GameTime gameTime)
{
device.Clear(Color.DarkSlateBlue);
device.VertexDeclaration = new VertexDeclaration(device, VertexPositionColor.VertexElements);
device.RenderState.CullMode = CullMode.None; // TODO only for testing!
device.RenderState.FillMode = FillMode.Solid;
effect.CurrentTechnique = effect.Techniques["ColoredNoShading"];
effect.Parameters["xView"].SetValue(viewMatrix);
effect.Parameters["xProjection"].SetValue(projectionMatrix);
effect.Parameters["xWorld"].SetValue(Matrix.Identity);
effect.Begin();
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Begin();
device.DrawUserIndexedPrimitives<VertexPositionColor>(PrimitiveType.TriangleList, vertices, 0, 5, indices, 0, indices.Length/3);
pass.End();
}
effect.End();
base.Draw(gameTime);
}
对于那些投票结束 - 我还可以问这个编程问题吗? – markmnl 2011-06-12 02:09:03
如果在此处关闭,请尝试在GameDev Stack Exchange(http://gamedev.stackexchange.com/)上提问您的问题。 – Empyrean 2011-06-12 06:37:52
带有Visual Studio的XNA是程序员常用的软件工具。根据常见问题,这与软件开发有关,不确定它应该被关闭。 – Empyrean 2011-06-12 13:52:31