XNA 3.1 vs. SDL
I've tried out both and although XNA 3.1 attracts me more because of t开发者_JS百科he ease of being able to just spew code out and not having to worry about memory and garbage clean up and all the nitty gritty crap. You get to write the fun part of the code (if thats even existant :D). However XNA restricts me because I cannot port anything I write with it to Linux or Mac OSX, and even then it makes people who want to play my games have to download .NET 3.5 Redistributable and XNA 3.1 Redistributable which should just not happen. I should be able to just have some DLLs in there as opposed to making my gamers go online and download stuff. Even then there is still the fact that the code will become an absolute mess over time because of the whole "one file for your game" default policy with XNA.
Which do you think is superior?
Really this is going to depend on your level of experience with C++ and if you really see not being able to port your code as a big problem. As for the memory management stuff... SDL gets a lot easier when you use some of the new features in the C++0x standard such as shared_ptr and unique_ptr, lambdas etc. Even the things in the SDL that require raw pointers are doable as you just use the .get() function on your smart pointer and your life is much easier.
In short: Good at C++ and if you are really interested in easily porting your game to other Systems then I would go for SDL. If you only really know C# and dabble in C++ and it's not a huge deal to only have your game on Windows and Xbox then definitely go for XNA.
I personally prefer XNA. Regardless of personal bias, Microsoft knows how to make some pretty mean software dev tools. XNA is very seamless, and despite its limitations is a wonderful experience. Although the lack of portability is frustrating, at least you can put it on the xbox :)
What do you mean 'one file for your game' policy? You can create just like any other VS project.
From personal experience, far and away XNA. Being able to - to use your phrase - "just spew code out" and rapidly throw things together is a huge benefit in game development.
Obviously I do not advocate that all code is "spewed" out. But the nice thing about C# and XNA is that they give you the option to be less careful about how you code - which you can then exercise in places where it is appropriate.
With C++ and SDL you are forced to write the vast majority of your code "carefully". (Not to mention the fact that you will get it wrong at some point, and C++ is so much more unforgiving about this.)
Some of the problems you mention ("one file for your game", requring a .NET 3.5 redistributable) are not actually problems with XNA - as discussed by Veered and myself in comments. Also, if you use ClickOnce to distribute your games, then it will handle the necessary download and installation of XNA and the .NET Framework for you.
If you have identified a need to port to Linux and Mac, then I would still advocate using C# (via Mono) as a development language - even if you have to use something other than XNA on those platforms.
And there are a bunch of other nice things about XNA and C# - the considerably faster compile times, the content pipeline, the support/updates from Microsoft, the ease of porting to Xbox 360 and Windows Phone, the library of well-written examples, etc.
My vote is for XNA.
I actually began my game using SDL.NET + C# (which covers the memory management that you described, while staying true to SDL) awhile back to learn C#. So if you do indeed like the perks of .Net you could check into that. However, once I discovered XNA and messed around with a few small test games I decided that porting my work over to XNA would be worth it (as I didn't care for cross platform anyhow).
I do understand what you mean when you say the 'one file approach'. Although as others mentioned, this isn't the actual end result, just the way it is presented to be like 'Hey look how easy everything is, update and draw now you got a little guy walkin around shooting fireballs out of his eyes!' Things in XNA feel much more structured than SDL, more hand holding if you will. XNA is easy to pick up and to get done what needs to get done, letting your good coding practices fall into play along the way.
精彩评论