Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionI am starting out learning XNA and its going smoothly. However I wonder if I am shooting myself in the foot by learning 3.1 not 4.0?
I am aware of whats new: http://msdn.microsoft.com/en-us/library/bb417503.aspx, and that mostly seems to be phone, interfaces and video features - which I am not so interested in - I am more doing the core 3D stuff.
The sticking point is: I have Visual Studio 2008 professional already and do not want to get VS 2010 if there is little difference in the game programming in 4.0.
Has the world moved on? Is what I am learning in 3.1 going to be come redundant?
There are also code differences in libraries, but they are not major, many of them can be seen here: http://www.nelxon.com/blog/xna-3-1-to-xna-4-0-cheatsheet/, for instance this one which I had to figure out compared to Riemers Tut:
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>(开发者_JAVA百科PrimitiveType.TriangleList, vertices, 0, 5, indices, 0, indices.Length / 3);
pass.End();
}
effect.End();
base.Draw(gameTime);
}
Yes. The world has moved on. XNA 3.1 is already redundant.
There are Major Architectural, API and under the hood changes for 4.0. The changes are significant, especially with regard to rendering. You are better off using VS2010 Express and XNA 4.0 than VS2008 Professional and XNA 3.1.
first time posting. There was a similar question posted in the game development stackexchange which can be found here (and reiterates what you said for the most part) https://gamedev.stackexchange.com/questions/7553/difference-between-xna-3-1-and-4-0 As for my experience our team started developing in 3.1 and ended up porting to 4.0 about halfway through our project. 4.0 seems to force you into one of two specifications "Reach" which is the low end and has a lot of restrictions based on the mobile GPU for winPhone7 and "Hidef" which basically means Xbox and wouldn't start on any of our computers that did not have at least a DirectX 10+ card. I like the organization of 4.0 better than 3.1 however it is geared much more in tune with the winPhone7 and Xbox where as 3.1 has some features that are PC only. Since you're learning XNA the option is still open to use either, however if you feel the need to port from 3.1 to 4.0 in the future it may be somewhat difficult. I was developing the audio for our game and found a lot of the changes in 4.0 very useful however our team did have some hiccups converting a lot of the graphics. Hope this helped! cheers!
精彩评论