Is it worth it to learn .Net for XNA?
As a developer I have put most of my efforts into learning Suns Java libs. However, I am really looking foward to coding for XNA, my only consern is:
Is it worth my time learning the .Net libs, specifically GDI+, Or will XNA use different libs for graphical output.
Will there be a way to draw primitives? I can't find how to draw primitives easily in .Net. I really like using Primitives for gaming becuase they save memory, and I can't draw well. Speaking of that(and getting way! off topic), has anyone heard ofKenta Cho? He makes all of his games using simple primitives, although in OpenGL, and XNA is DirectX like.
Anyway, my point is. Will XNA have a more game centric library than .NET? and will it have prebuilt common classes like Sprite or Collision lists?
I wouldn't worry about the GDI+ part of .NET if you're going to do XNA development unless it's for simple windowed games (say a Tetris clone) but other areas of the Framework you should be comfortable with.
There's functions in the Graphics class for drawing shapes, but you don't really want to use it for game development. DirectX has functions for doing simple primitives (check the Device.DrawPrimitives method) and these should be part of the XNA Framework. An example from the SDK Help:
This example shows how to begin scene generation and draw primitives.
The SetStreamSource method binds a vertex buffer to a device data stream to create an association between the vertex data and one of several data stream ports that feed the primitive processing functions. The parameters for this method are the number of the data stream, the name of the VertexBuffer object, and the stream vertex stride.
In the following C# code example, it is assumed that the device is the rendering Device, and vBuffer is a vertex buffer filled with CustomVertex.PositionNormal data.
device.BeginScene();device.SetStreamSource(0, vBuffer, 0);
device.VertexFormat = CustomVertex.PositionNormal.Format;
device.DrawPrimitives(PrimitiveType.TriangleList, 0, 1);
device.EndScene();
I would recommend downloading the DirectX SDK and C# Express and looking at the samples and tutorials in the SDK.Hi Kevin,
> Is it worth my time learning the .Net libs, specifically GDI+, Or will XNA use different libs for graphical output.
The namespace System.Drawing (GDI+) won't be supported in the XNA Game Framework so it's certainly not a high priority for you to learn it.
By the way, if your switching to C# from Java then this article might be helpful
http://msdn.microsoft.com/vstudio/java/gettingstarted/csharpforjava/
> Will there be a way to draw primitives?
Of course, that's what the XNA Game Framework is all about. It contains namespaces for drawing, audio, input, math and other things that you need when writing a game.
> I can't find how to draw primitives easily in .Net
That's because in the core .Net framework there are no functions to talk to the graphics card directly.
Microsoft does provide a library that does give you this ability though. This library is called MDX (Managed DirectX) and ships as part of the DirectX SDK. You could browse the documentation for MDX to get a feel of the kind of functions available. MDX is basically a very thin wrapper over Direct3D 9.
The classes in the XNA Game Framework graphics namespace were in fact inspired by the MDX library but for the most part they are not source code compatible. The XNA team wanted the classes in the XNA Game Framework graphics library to be easier to use than MDX and future compatible with DirectX 10 so they rewrote it.
> Will XNA have a more game centric library than .NET? and will it have prebuilt common classes like Sprite or Collision lists?
The libraries in version 1.0 of the XNA Game Framework provide core services to anyone that wants to write a game. Things like Sprites and Collision lists are higher level constructs that would be layered on top of these lower level services. The XNA team is looking to the community to develop higher level components. You can bet that someone out there will develop a sprite library for XNA fairly soon after release.
cheers
I would just like to say for the record, I LOVE THE MDSN FORUMS!
I get really complete and well made answers...
Unlike the Ubuntu forums...