开发者

SlimDX vs. SDL - Which is the best?

For those who have experience, working with VB.NET, it's easier to use SlimDX or SDL? The tutorials for SlimDX are开发者_JS百科 already written for .NET, but I've read that SDL it's a lot easier than DirectX itself. In my case, I just need 2D graphics.

Also, which language do you recomend. I usually use VB.NET, but probabily most tutorials over the internet are in C#, and I don't think it would be hard to learn it as I know C and PHP. :)


SDL can be a problem for users with older graphics cards, which tend to lack decent OpenGL acceleration. The .NET wrappers for SDL were out of date last time I checked as well.

When I was looking for a decent 2D hardware accelerated library for my .NET projects, I ended up using a library called Gorgon. Its based off SlimDX, and it focuses on making SlimDX more object oriented and easier to use for 2D applications.

It supports rendering to any control you like, you can freely mix it with Windows Forms stuff. Performance is basically the same as SlimDX, since its essentially a SlimDX wrapper.

Here's a few links if you're interested:

  • http://code.google.com/p/gorgonlib/
  • http://tape-worm.net/
  • http://www.tape-worm.net/forums/
  • http://www.facebook.com/pages/Gorgon-Graphics-Library/197556460277685


To answer the second part of the question:

VB.NET and C# are, for most intents and purposes, the same.

They compile to the same end code and have the same performance (if you change the overflow checking from each to match). Here's some of the differences:

VB.NET

  • Case insensitive
  • More verbose than C#
  • Has inherited the bad reputation from its BASIC predecessors, a lot of programmers (mostly C++ ones, I think) seem to look down on VB.NET as being inferior.
  • Less commonly used than C#
  • Has "With... End With", which I really wish that C# had.
  • Has overflow checking on by default
  • "My" namespace

C#

  • Case sensitive
  • Slightly worse usability - Having used both C# & VB in VS08, I've found that C# intellisense is ever so slightly less intelligent.
  • C# requires you to cast data types a lot more, although this allows you more flexibility.
  • More popular
  • Closely related to other languages like Java
  • Has a few things that VB does not, such as the "unsafe" keyword.
  • /* Easy multi-line comments */
  • Has overflow checking off by default
  • No "My" namespace

There's very few scenarios where it'd matter if you picked VB.NET or C#, the main differences are simply in syntax, and the fact that a lot of programmers tend to look down upon VB.NET as being "inferior" (Which I think is just being programming-language-ist, but thats how it is, unfortunately)

That said, it is probably worth switching from VB.NET to C#, because:

  • Its not going to be too difficult a change, since they're much the same
  • Learning another language is always a good thing
  • As you said, C# has more tutorials availible, which will save you translating code
  • From a career standpoint, being able to say that you've done stuff in C# is going to be useful

Why not give it a spin? The only disadvantage I can think of is that you're learning two things at once (SDL/SlimDX + C#) but really, C# is dead easy.


It's probably worth noting that VB now has support for the XNA framework:

Getting started guide: http://create.msdn.com/en-US/education/gamedevelopment/VBSupportForXNA


SlimDX is a relatively low-level library. It lets you have access to the full power of DirectX, and you can target old legacy hardware as well as the new top-end stuff. This also means that it's difficult to get things set up, and you need a lot more code to draw simple things like sprites and text.

If you're looking strictly from a usability standpoint, SDL is probably a better bet for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜