Note that there are some explanatory texts on larger screens.

plurals
  1. POLearning XNA 3.1 Vs XNA 4.0
    primarykey
    data
    text
    <p>I 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?</p> <p>I am aware of whats new: <a href="http://msdn.microsoft.com/en-us/library/bb417503.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb417503.aspx</a>, 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. </p> <p>The sticking point is: <strong>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.</strong></p> <p><strong>Has the world moved on? Is what I am learning in 3.1 going to be come redundant?</strong></p> <p>There are also code differences in libraries, but they are not major, many of them can be seen here: <a href="http://www.nelxon.com/blog/xna-3-1-to-xna-4-0-cheatsheet/" rel="nofollow">http://www.nelxon.com/blog/xna-3-1-to-xna-4-0-cheatsheet/</a>, for instance this one which I had to figure out compared to Riemers Tut:</p> <p><strong>XNA 4.0</strong></p> <pre><code> 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); } </code></pre> <p><strong>XNA 3.1</strong></p> <pre><code> 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&lt;VertexPositionColor&gt;(PrimitiveType.TriangleList, vertices, 0, 5, indices, 0, indices.Length / 3); pass.End(); } effect.End(); base.Draw(gameTime); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload