Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I decided to learn to program in DirectX yesterday, and, not being a huge C++ fanatic, went looking for a .Net wrapper. After reading about SlimDX and SharpDX, I decided I liked what the SharpDX people were doing and began trying to use it. Although they have a huge number of samples that are really nice, I had trouble finding any tutorials specifically for it. I ended up seeing a huge number of C++ tutorials. Besides the really long and less than aesthetically pleasing function names, it really didn't seem any more complicated than using the managed wrappers.

So my options (and what I think about them) are:

  • SlimDX/SharpDX are in a language I am familiar with, but nearly as complicated as the C++
  • DirectX is C++, something I am not too familiar with. I would really need to learn proper memory management.
  • Focus on really learning C++ well before diving into game programming with straight Direct3D. This would allow me to learn proper memory management and get comfortable with C++.

My original thinking was that if using Direct3D was just as easy as a managed equivalent, there would be no point starting with the managed equivalent. On the other hand, if the managed equivalent is much easier, it would allow me to focus on the ins and outs of developing a game rather than constantly worrying about the language and getting even small things done.

So, will using one of these managed wrappers be easier than using the native Direct3D API itself?

share|improve this question

closed as off topic by Tetrad Jan 30 '12 at 0:49

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
It totally doesn't make sense to ask whether to use SharpDX/SlimDX or DirectX. That's becaus SharpDX/SlimDX are thin wrappers around DirectX. They expose almost exact same API as native C++ API to managed world. It's like asking - do you drive to work automobile or Honda. –  Mārtiņš Možeiko Jan 29 '12 at 21:18
1  
Also, there isn't really such a thing as "proper memory management" in a language-agnostic sense. There is the kind of memory/resource management you have to do in C++, and there is the kind you have to do in C# (just because you have a GC doesn't mean you can pretend you have infinite memory). You can learn just as much about general resource management techniques in C# as in C++; I wouldn't consider that a compelling reason to bother to learn. Both are abstractions over reality anyhow. –  Josh Petrie Jan 29 '12 at 21:59
5  
While It is subjective, there are still lots of facts that deserve a post. Because this is closed, my response here pastebin.com/RcVFRVm5 –  xoofx Jan 30 '12 at 2:04
2  
@Tetrad I vote for this to be reopened, if anything because I find the answer given by xoofx to be quite interesting and deserving of being preserved. –  David Gouveia Jan 30 '12 at 11:27
1  
@Noctrine I am aware, but it is a shame that xoofx's answer will remain as a pastebin on a comment then because he wasn't fast enough to post it. –  David Gouveia Jan 30 '12 at 18:52

2 Answers 2

up vote 1 down vote accepted

If you're not a huge C++ fan, then the question I have is, are you already competent at C#? Any way you slice it, DirectX and its related APIs are fairly complex and you will get stuck in some places if this is your first time using a 3D graphics API. Because they are merely wrappers, they involve low-level stuff that you have to deal with on your own. If you decide you want something a bit higher-level than SlimDX or SharpDX, XNA may be another option for you, but at the trade-off that it's limited to Direct3D 9-level graphics.

The best thing, in my opinion, about using a managed D3D wrapper is that you don't have to really worry about memory leaks! The only major performance profiling you'll have to do is GPU efficiency (obviously) and garbage collection rate.

share|improve this answer
    
I guess the answer to the question on competency would depend on what you mean by competent. I certainly wouldn't call myself an expert, but I would probably guess that I am competent. When you say "low-level stuff that you have to deal with on your own," do you mean DirectX related things (buffers, models, shaders, etc) or more generally C++ related things (memory management, pointers, etc)? –  Patrick Jan 29 '12 at 23:07
    
When I mentioned low-level stuff, I mean the stuff that is usually pertinent to most graphics APIs, so basically handling buffers, shaders, API render states, etc. –  ChrisC Jan 30 '12 at 19:09
    
Ok. This is what I was hoping. Thank you. –  Patrick Jan 31 '12 at 15:28

As APIs, SlimDX and SharpDX are almost exactly as difficult to use as the native D3D API or any other APIs they encapsulate. With a few minor exceptions, any ease-of-use benefit you get from either API comes primarily from the fact that you're using a higher level language (C#). This is because, as Martins points out in the comments on your question, they're both lightweight wrappers.

share|improve this answer
    
This is about what I was seeing. So, do you think it would be easier to learn DirectX (knowing I don't know much C++) or SharpDX (knowing there seem to be very few tutorials for it)? –  Patrick Jan 29 '12 at 22:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.