Friday, September 26, 2008

DirectX 10

I've decided to finally start dabbling with DirectX 10. The main reason behind it is that I want to work with Geometry Shaders. There is no official C# wrapper around DX10, but I did manage to find two third-party ones. One had not been updated since April 2006, so I threw that one out the window. The other, SlimDX, has been in very active development and a new version was just released this month. I downloaded it and played with some of the samples and was rather impressed. However, SlimDX also provides a wrapper around DX9 and it is very clear that that was the priority of the project. There are quite a few things missing from the DX10 wrapper that would have been very useful.

So, instead of fighting through a third-party C# wrapper, I figured I might as well go back to the straight C++ version. This has the advantage of having tons of official samples and tutorials from Microsoft. However, this has the major disadvantage that I have not worked in C++ directly for almost 4 years. It is rather rough going back to C++ from C#. There were so many helpful things built into C# that aided in rapid development. I mean, C++ doesn't even have a string type, you have to use char arrays. (Edit: I forgot that it does support strings, but you have to include the header for it first. Doh!) I feel like I'm stepping back into the dark ages! :-P

I'm hoping to have just the basic C++ code to draw a model using a shader, and then all of the rest of my work will be in HLSL. We shall see!

(Edit: I found a really helpful C++ tutorial for getting me back up to speed. http://www.cplusplus.com/doc/tutorial/ )

3 comments:

Promit's Ventspace said...

Do you remember what was missing from the SlimDX DX10 support? It's difficult for us to continue to add stuff if we don't know what people are looking for.

Patrick said...

Hmm, if I remember correctly I was trying to load a mesh from a file. I couldn't find the method that exposed that functionality.

To be honest, I've been meaning to go back and look at SlimDX again after having now seen how DX10 actually is laid out and works.

I can understand your frustration with having a developer complain about your application without them ever mentioning the specific problem to you. So, I apologize.

I was never expecting an actual developer of SlimDX to read my blog. How did you come across it?

Thanks for commenting.

Promit's Ventspace said...

The number of people talking about SlimDX is relatively small, so I simply keep an eye out for what shows up on Google. Anyway, just let us know one way or another when you encounter issues with SlimDX, even if you're not sure they're actually related. We like to help our users out and right now things are at a size where it's still perfectly feasible.