Sign in to follow this  
Mythics

DX9 vs XNA

Recommended Posts

I've done enough research to know that I'd personally prefer DirectX9 in comparison to 10 at the moment, but I'm still a little curious about XNA. I've watched a few videos, seen the slide shows Microsoft offers, and read a little bit of user input.. but I thought I'd go ahead and directly ask the community here in hopes of an individual that's used DirectX and XNA both and prefers one to the other. So, anyone in deep enough with XNA (with a DirectX background) to say they love it or hate it? I'm learning C# pretty quick and hope to start putting it to actual use in a week or so, and although I've seen a little of DirectX8, I was just wanting to get a better user standpoint on XNA vs DX9 where-as just reading about it on Microsoft's website makes me think it's getting pretty glazed over with a VERY thick layer of icing. Either that, or reading Microsoft's information is glazing me over a little.

Share this post


Link to post
Share on other sites
XNA is a .Net wrapper over DX9. Managed DirectX is also a similar .Net DX9 wrapper, but it uses .Net 1.1 syntax instead of 2.0 like XNA. XNA also has the Content Pipeline and will work on Windows and XBOX 360, where MDX only works under Windows.

I know you didn't ask about MDX, but I thought I'd throw it in there(it doesn't get enough love these days). Seems I might be the only person that doesn't use Visual C# Express and prefers MDX.

Share this post


Link to post
Share on other sites
Quote:
Original post by Scet
XNA is a .Net wrapper over DX9. Managed DirectX is also a similar .Net DX9 wrapper, but it uses .Net 1.1 syntax instead of 2.0 like XNA. XNA also has the Content Pipeline and will work on Windows and XBOX 360, where MDX only works under Windows.

I know you didn't ask about MDX, but I thought I'd throw it in there(it doesn't get enough love these days). Seems I might be the only person that doesn't use Visual C# Express and prefers MDX.


Just getting into .Net, what's the difference between 1.1 and 2.0?

Also, your description kinda leads me to think XNA would be the better... yet you say you prefer MDX?

What do you use? VB.Net?

Edit:
I just looked a little deeper into the content pipeline within XNA and.. well, I'm being pushed pretty hard into XNA. Going C# of course gives me that option, and it looks like a pretty good one to me.

Share this post


Link to post
Share on other sites
There are lots of differences between .net 1.1 and 2.0, but for most users, the most important one is the introduction of generics in 2.0. They're .net's equivalant to c++ templates, and are a joy to use. I believe 2.0 had a performance boost too. VB.net 2.0 also had a lot of much needed improvements to the language. Overall, you definately want to use 2.0.

Xna is a very nice API, but it has cons. One is that it has no fixed function pipeline. Meaning that a lot of things that are done automatically in direct3d9 must be done by you in a shader. That can be a pain in the butt, and daunting to a new programmer.

Xna isn't as feature complete as managed directx either, though it's going to get there. It's missing video playback, 3D audio (which will be in the next xna release), networking, and one or two other things I can't think of at the moment.

I'm with Scet. For me personally, if I didn't care about the xbox, and just wanted to develop for windows, I'd stick to managed directx, hands down. It's feature complete, fast, and it's api is very similar to the c++ api, so it's easy to find lots of usable directx sample code.

VB.net is only slightly less powerfull than c#, and is a perfectly viable route for game development. You just won't be able to port to the xbox (the likelyhood of xna ever supporting vb.net doesn't sound promising).

Keep in mind that you can use opengl from .net languages too.

[Edited by - gharen2 on April 6, 2007 9:32:15 PM]

Share this post


Link to post
Share on other sites
Comparing the XNA Framework with DX9 is pretty difficult, heck comparing the XNA Framework to MDX 1.1 can be pretty difficult [smile]

Quite simply, the XNA Framework is not DX9, it does have D3D9 under the hood sure, but the rest of those X parts of DX9 in general are pretty much not there or changed so much it can really be said to be apples and oranges.

I come from a DX9 background, both native with C++ and managed with C# and MDX 1.1 (which as Scet rightly pointed out, doesn't get enough love these days as it still rocks) and I really do love the XNA Framework ...most of the time [wink]

It is rarely plain sailing though and a lot of the things I take for granted being in DX9 are sometimes missing as the XNA Framework is still very young. I was seriously almost ready to completely stop using it when I found out occlusion queries weren't in it yet (...hopefully "yet" cause there has still been no word on these) [lol]

Despite this love/hate relationship I have with the XNA Framework, it has a lot of cool parts to it that can make it really enjoyable to work with, and the parts to it that are done are done really well (it is a lot better designed than MDX 1.1).

I still love DX9 and MDX 1.1 though [smile]

Regards,
ViLiO

Share this post


Link to post
Share on other sites
Why would you prefer DX9 over 10? The only reason I can see is that no one is able to use 10, which is a pretty good reason I suppose. If I had a DX10 capable card and was just working on side projects, I'd definately be making DX10 apps.

I'm using both MDX and Xna at the moment for various things, and I don't really like Xna too much at the moment in comparison to MDX. First of all, if you're experienced in DX and managed programming, MDX comes naturally. I find Xna too complex for new users and too simplified for more experienced users - not a good place to be in. For example, a lot of handy utility functions I took for granted in D3DX don't seem to be around. Data types are a little different too. DX has a nice ColorValue struct with floating point components. What happened to it in Xna?

I'd really like to put things on the Xbox360 though, I just need to get one first.

Share this post


Link to post
Share on other sites
The most interesting point of XNA imho is that it's being ported to mono, which means Linux (and hopefully other consoles as well). Never heard of anyone trying to port DirectX.

I've never tried XNA, but judging by their migration guide, they've removed and changed some things that just should've been left alone (fixed function for example).

Share this post


Link to post
Share on other sites
Quote:
Original post by stanlo
Why would you prefer DX9 over 10? The only reason I can see is that no one is able to use 10, which is a pretty good reason I suppose. If I had a DX10 capable card and was just working on side projects, I'd definately be making DX10 apps.

I think that for a lot of hobbyists, dx9 would still be favorable over dx10 because it has a fixed function pipeline.


Once dx10 hardware is found in most homes (in a couple years I bet), dx10 will definately be favored by commercial developers. But even then, I bet a lot of hobbyists will use dx9, because it has a fixed function pipeline, and full exploitation of the advantages of dx10 requires a high level of knowledge and skill. And Vista does support dx9 alongside 10 after all.

Quote:
Original post by DvDmanDT
The most interesting point of XNA imho is that it's being ported to mono, which means Linux (and hopefully other consoles as well). Never heard of anyone trying to port DirectX.


I've been following mono.xna, and they're doing good work. I do feel that porting 2D sprite xna games to linux and osx will be trivial, and I believe they're well on their way to accomplishing that. However, making the 3D stuff portable will be very unfun, due to the differences between opengl and d3d, and because d3d shaders aren't guarenteed to work in opengl, even if you use cg. They seem to be a pretty professional bunch though, so I'm sure they'll pull something off.

But whatever they do, for a 3D xna game to be portable, it'll have to be designed from the start to meet hatever design requirements mono.xna has. Making an existing 3D game run on mono.xna will probably require a lot of ugly hacks.

I suspect many people will still prefer to use opengl to create crossplatform 3D games.

[Edited by - gharen2 on April 6, 2007 9:52:15 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by stanlo
Why would you prefer DX9 over 10? The only reason I can see is that no one is able to use 10, which is a pretty good reason I suppose.


I've just always been of the nature that if it's just under the top of the line, it's most likely safer than the top of the line itself. Vista for example, I'll be giving it another year probably before I even bother with it at all. Too few companies will be using it widespread for a long while, especially the one I currently work for.

Besides that, yeah.. My hardware is semi-decent, but not anything like what DX10 needs/can utilize.

Share this post


Link to post
Share on other sites
One thing to keep in mind is that XNA is not just an API like DirectX9 and Direct3D10 rather XNA is an entire framework for making games. Think MFC. Also if you are a hobbiest or an indie and want to make Xbox 360 games then XNA is the only way to go short of shelling out for an XBox dev kit.

Share this post


Link to post
Share on other sites
Quote:
Original post by dpoon
One thing to keep in mind is that XNA is not just an API like DirectX9 and Direct3D10 rather XNA is an entire framework for making games. Think MFC.


This is an exageration. Xna is only slightly more high level than managed directx. Xna just simplifies graphics device initialisation and management. Otherwise, Managed directx is just as much a "framework for making games" as Xna. If anything, managed directx supports more features. By this rationale, one could say the same about the OpenGL, SDL, OpenAL, and DevIL combination.

Other than the simpler device management, development with Xna involves just as much learning and work as managed directx. You still have to work with low level things like states, pixel formats, vertex buffers, textures, matrices, quaternions, etc etc. In some ways you have to learn more, as you'll be forced to use shaders for non-sprite stuff.

I like Xna, but let's not over-hype it.

[Edited by - gharen2 on April 6, 2007 10:16:38 PM]

Share this post


Link to post
Share on other sites
Quote:
Despite this love/hate relationship I have with the XNA Framework, it has a lot of cool parts to it that can make it really enjoyable to work with, and the parts to it that are done are done really well (it is a lot better designed than MDX 1.1).


I finally got away from MDX1.1 to do some XNA development and I have to say I like it a lot. At first I wasn't too happy with many changes from MDX, but once you get around to the XNA side of things it's a very nice platform to get things up and running in no time. I wouldn't say it's that much better designed than MDX though, since they serve different purposes. MDX was essentially just meant as a lightweight DX9 wrapper (and I think it still does a good job there), while XNA includes some structure you'd have to code yourself when using MDX.

As gharen2 pointed out, it's just a somewhat more high-level API than MDX and it can at times be a pain to get around the limitations imposed by the 1st version of the API. Device management for example is a lot easier to start with, but getting more exotic scenario's to work is somewhat harder. They've also dropped the fixed function pipeline, which can make some simple tasks a bit of chore.

Indeed I'd say it's just a layer of icing, but not overly thick yet. I figure MS will keep adding to the framework though (like they do now with the font stuff etc), so in the long run it will have a big standard library, which is a good thing.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this