Managed DirectX – Have you used it?

So I asked before what types of features you would like to see in Managed DirectX (and the feedback was awesome - I'm still interested in this topic)..  What I'm also interested in that I didn't ask about back then though was what types of things people are using it for currently? 

Are you using it to write some tools?  Game engines?  Playing around on the weekends?  What experiences have you had working with the API?

Comments (35)

  1. Writing a game engine for creating indie games.

    The experiences have mostly been good, except for the lack of documentation which I know you are aware of. Also I would like to see MDX run through FxCop – I know certain elements of it could be more .NET-ish (naming conventions amongst other).

  2. Jon Galloway says:

    Sound processing, playing around in spare time. I’ve been working on a collaborative cellular automata music generation that’s been pretty challenging.

    MDX has been 10 times easier to use than DX6 – 8 because coding mistakes don’t lock up my machine. I’d love to see the DirectShow filters accessible via MDX, and to make it possible to write MDX sound plugins.

    I understand that DX isn’t a game engine, but it might make sense to eventually have a DX game engine layer that runs on the DX core. That’s not my interest, but it looks like it’s something other folks are asking for.

  3. nfactorial says:

    I’ve been using it to create a heightfield editing tool (

    Though this is mainly a precursor to converting a 3D editor I was working on in C++DX9 to C#MDX. I’m basically looking at how to structure C# applications and using C#MDX effectively(, C++ version).

    I’m also working on a data driven game-engine as a research project, which is going pretty well. No screenshots on that one yet as most of the work is in the framework and my artistic talents are zero, so its just cubes walking around.


  4. nfactorial says:

    As far as experiences, I’ve chosen MDXC# as my main home development environment now (which used to be C++DX9). So it’s very good for me.

    Some things I don’t like though are the portions of the API where it seems to be trying to remain too close to the C++ API. Such things like, DirectInput returning an array of bytes for MouseState.GetMouseButtons when it would make much more sense to simply have a MouseState.IsPressed( int button ) or something.

    Or AudioVideoPlayback classes not supporting creation from streams (which means my audio has to be in a file on its own rather than contained within a package).

    A few other issues as well, but these are only minor compared to the entire API. Which works and works very well so far 🙂



  5. I am getting ready to use it in a medical imaging app because I am hoping that using shaders I can perform fast image processing. I previously implemented this using System.Drawing and it was horribly slow. Hopefully Managed DirectX is the answer to my woes.

  6. Xas says:

    Yep, trying to do a mathematical 3D functions viewer….

  7. Stratching the MDX surface for a pet project, a Connect4 game using minimax/alpha beta pruning. More real usage later on.

    Having said that, it would be better to have MDX more .NETish as n! mentioned. Ex: I can refer to the DefaultView instance of a DataTable and play with it, so I’d like to refer to a "scene" object rather than going over a global "device" object.

    It’s very very easy to code with MDX, on the other hand. Thanks.

  8. Brian Brown says:

    I have been using MDX to build in house engineering tools. Mostly viewing models with complex reflections. We are in the process of writing new CAD environments using MDX as well. It has been pretty easy to use MDX. I chose to go that way as our developers moved to .Net. Before, we used OpenGL for all of our internal apps.

  9. Stone says:

    I’m trying to do build an editor for my forthcoming game. I’m an absolute beginner in coding DirectX-apps and for me it’s difficult to understand all the math (like picking an object in my 3D-editor).

    But don’t get me wrong – I like MDX very much, cause it’s very easy to handle and I think, I’m able to solve my math-problems 😉

  10. Dev0 says:

    I like MDX a lot. I’m using it to make a 3D Game engine and it’s set of tools. I’m expereinced in Unmanged DX9 and was very impressed with MDX so I started this new game engine project with MDX.

    The only gripe I have at present is trying to use Windows Media 9 encoded sound files with Managed DirectSound. Was hoping to have that functionality built in…or at least Ogg and MP3 support.

  11. Lucas Menge says:

    MDX is very nice. it’s easy to get a hang on it. i decided to start getting into the basics of Direct3D because of it. As a learning process, i decided to make a "simple" app launcher (check my url for it). it came in really handy for some stuff. blazing fast when it comes to rendering.

    earlier i tried doing some DirectInput stuff with it but never actually got around finishing it because i couldn’t figure out how to do some things (that i did b4 with DI8) on it. documentation on that front was really a big problem for me.

    overall the api is great to use. the only shame i might say is that we need to support sooo many different video cards….

  12. Enhanced says:

    I wish there was documentation on DirectShow for !!! and pre written examples.. I’ve used managed direct x for little things like music players and such. I am just getting into this type of coding and find it hard getting documentation for DirectShow for

  13. nfactorial says:

    An extra thing, not quite related to MDX but maybe you’re in a position to push it a bit. Is native managed support for matrices and quaternions (as well as single precision math support).

    Given the fact that managed code is stored in intermediate assembly language and the JIT. It would be awesome if the .NET framework had intrinsic matricesvectorsquaternions etc. So that when compiled by the JIT they evaluated directly to optimized versions for the host processor.

    Again not quite in MDX’s realm, but would be *really* cool. 🙂


  14. Kavan says:

    Using it to create a game engine and games on top of it. I’ve been satisfied with performance as it’s along the promised values even in bigger projects. You just have to know what you’re doing and know it really well. There are still some really nasty bugs in there, but being in beta enables me to bring up a lot of problems and most of them get corrected sooner or later. I only wish the patch cycle would be shorter. Waiting for a whole year while you know the problem is already solved is really annoying.

  15. BradC says:

    I am using it to do a 2d game using 3d. Would love to see more int the way of 2d. As it appears directdraw may go the way of the dodo… would be nice to see d3d pick up its routines. Sprites seem to do a great job (speed wise), but dd has all the good drawing routines.

  16. santy says:

    I am using it for a complete 3d engine ( graphics, sound, input, network, collisions, physics )…. And really love it.

  17. Henry says:

    Currently I am using it as a platform to learn 3D Graphics programming on.

    I’m hoping to eventually build up enough basecode to build a complete 3D game engine on.

  18. Henry says:

    Currently I am using it as a platform to learn 3D Graphics programming on.

    I’m hoping to eventually build up enough basecode to build a complete 3D game engine on.

  19. OK, So all I’m trying to do is capture from my web cam one frame, to save out to a bitmap. That way I can have my own software that auto-uploads my web cam pics to my web site. All I have to say is OMFG!

    I have been at it all day today converting a simple SampleGrabber app over to from C#. Now the C# to conversion thing that’s easy. But what I have discovered today is that I am glad my interest in DirectShow has been non existant. There has to be atleast 400+ lines of code involved just to get the web cam to take a picture. HELLO! Let me repeat! Just to take a Freaking picture = 400+ lines of code!

    DirectShow is now by far the most horribly overly complicated API I have ever come across in my 10+ years of programming! Bar none! I cannot believe how much code it takes just to get a web cam to take a picture.

    Mister Miller. For the love of god, save us all and simplify/streamline/Delete DirectShow and start a new if you have to, just please do something to simlify the DirectShow api.

    All I have to say is God I hope by the time Longhorn, comes around you guys have it fixed.

    Unbelievable! Monkeys on acid could write a better DirectShow API then the state it’s in today!

    The SampleGrabber app I am converting from C# to can be found here …

    I am seroiusly stunned about this …

  20. OK so here is an idea for you guys …

    ‘Captures a frame of video from the first availible device, saves it, then exits.

    Public Sub Capture()

    Dim Device As DirectShow.Device

    For Each Device In DirectShow.Manager.DeviceListEnumerator

    If Device.Category = DirectShow.FilterCategory.VideoInputDevice Then

    If Device.Connected Then

    Dim CapDev As New DirectShow.CaptureDevice(Device.ID)


    Dim Img As Image = CapDev.CaptureFrame

    Img.Save("Test.bmp", System.Drawing.Imaging.ImageFormat.Bmp)


    Img = Nothing



    CapDev = Nothing

    Exit Sub

    End If

    End If


    End Sub

    … Now if you guys can improve capturing a video stream with DirectShow to something akin to the example above I would be impressed.

    Longhorn is a long way off. Take your time. Get it right. But if you have not made DirectShow this simplified by then, I’m going to shake my head in shame at you people!

  21. Dan Colasanti says:

    I’m have been using it to teach an introductory game programming course at a university. It’s a 2D GP course, and although most of your book is on Direct3D, I was still able to use chapters on DirectSound, DirectInput, DirectDraw, DirectPlay, and some sidebar comments from other chapters.

    Your book was very useful, but for my course I’m still hoping to find something more like "Inside DirectX" by Bargen & Donnelly (pub’d in 1998 for DX5) rewritten for MDX.

    One quick question: The DuplicateSoundBuffer method from previous versions of DirectSound does not seem to exist in MDX – what has happened to it?

    Anyone with an answer – please reply to: (thanks)

  22. Bulma says:

    I used it for our game project:

    and for 3D part and even some math calculatins (D3DX math classes like Vector come pretty handy sometimes…) for my diploma thesis (mobile robot control)… It helped me a lot…

    Last week, I was on MS WinDays2004 conference here in Croatia, and saw that some guys use it for simulation and control of manipulator in reactor chambers…

  23. Ben Vanik says:

    I’m using D3D, DInput, and DSound for an big indie gaming project. The entire system (server suite, client, and tools) are done in C# and MDX.

    I would really like to see are extensions to the Geometry class and maybe some assorted helpers. E.g., more of the useful kinds of things like intersection tests (sphere-box, box-box), and a camera helper (basic culling, etc). The quick tools that C#/MDX is so good for often require that kind of stuff, and some well written ones inside the library would be great.

    I would also like to make a vote for full support of VS2005 when it’s ready. Maybe, assuming something breaks a refresh update that could be downloadable when it is released to ensure compatibility with the new framework?

    With a taste of generics from the PDC build, I can’t wait to start building everything off of it, and don’t want to miss a beat!

    Keep up the good work. I am excited about the next release of the beta with hopefully more docs/samples!

  24. Silmar says:

    This does look very exciting, however finding resources is quite hard, I have been able to find a couple of resources.

    Living in Australia I had to special order your book Tom, cant wait till it arrives (very hungry for information)

    Coming from a .NET background in the business sectors I am looking forward to dallying this up with my interest in 3dsmax.

    My first project will be to create a GUI environment which will mimick an operating system. Does anyone know a good place where I can get some tips on this? I have seen CrazyEddies GUI and believe the AXIOM MDX engine will be porting it to C#.

  25. Rather than making a big post here I will direct you you my web site.

    You can either look for the May 12, 2004 blog post called "Textured Index Buffers for D3D" or you can find the document under the Development link on the sidebar. Look for the "Textured Index Buffers for D3D" link under the DirectX category.

    I’m hoping this post does not crash my site,… but well see.

  26. Eric Bickle says:

    I’ve been using it to build an isometric RPG game engine 🙂

    As for the features I’d like to see – above all, more integration into the Visual Studio help system. XML comments for code-complete, and true .NET style documentation (not the difficult-to-comprehend older style you currently use).

    Also, why does the documentatation say that it is in beta? Isn’t managed direct-x release code?

    Parts of MDX don’t make sense from a ".Net" point of view. The naming can strange, and there are methods where there should be properties. (ie/ the "raise_DeviceLost" event, which should be named "OnDeviceLost" and also be virtual)

    I couldn’t find any way to determine the *real* size of a texture (not the source image’s size, but the in-memory texture).

    I also heard rumors that for MDX to work, you need to deploy a redistributable file (in addition to Direct-X itself). I’m not sure if this is the case (I have the SDK installed), but if it is, it sure would be nice to have it as part of the base Direct-X install (I think it is, but some people were acting as though it wasn’t in a discussion board once…)

  27. Eric Bickle says:

    I also would suggest that it would be *very* nice to have "Direct-X" friendly Form/Application classes (or something similar) that allow for more control over the main application’s message loop.

    DoEvents isn’t tight-loop friendly, and there are minimal alternatives (other than rewriting everything from scratch – goodbye form designer!)

  28. F176 says:

    I’m not a professional programmer but MDX made me can make a game cause game can be created with no &, * or __s (double underlines).

    I started programming with VB, so I’m afraid of any above operator characters. C# + MDX is the savior for me.

    And so, it made me from complex mathmetical problems. Of course, I didn’t learn any high level math class.

    For indie game programmer like me, Math helper classes really helpful.

    But, DShow, DMusic and more samples about HDR rendering needed.

  29. Thomas Fisher says:

    I need Managed DirectShow classes in the worst way!

Skip to main content