Managed DirectX and MDXInfo primerBy Rim van Wersch, June 24 2006 |

[ What is MDX? ] [ What do I need? ] [ MDX Coding ] [ Where to go from here ]
On this page you'll find a guide to get started with Managed DirectX (MDX) from scratch and how the resources on this site fit in to help you on your way. As mentioned on the Basics tutorial page, we have various resources available for coders who want to get into MDX programming, but they may not always be that easy to find. In this primer we'll point you to the various resources and lay down a basic path of how to go about learning MDX.
This may not be the most exhaustive primer, but we hope it'll help you to get off to a good start with MDX. We'll update the primer as much as possible to include new resources on the MDXInfo website and resources found on other MDX tutorial sites. If you have any questions, comments or suggestions please don't hesitate to drop us an e-mail.
What is Managed DirectX anyway?
Managed DirectX is a wrapper around the normal DirectX API that allows you to create multimedia applications (i.e. games) on the .NET platform. The calls to DirectX aren't mapped one-to-one, but the functionality available in MDX is equivalent to the power offered by the normal DirectX platform. The MDX platform is officially supported and endorsed by Microsoft and its performance is about 95% of normal (unmanaged) DirectX applications.
There have been countless discussions on the performance and maturiy of MDX, but the general consensus is that as long as you aren't coding a bleeding edge game which requires heavy (assembly & caching level) optimizations, you should be fine using MDX. The platform has indeed come a long way in terms of maturity, but since the Summer 2005 SDK release it has grown to be a professional platform. Since December 2005 the MDX runtimes and all dependencies have become part of the official DirectX runtime, so the deployment issues that plagued MDX applications have also been solved.
There is one thing remaining that keeps MDX from becoming a mainstream game development platform and that's portability. Currently MDX only runs on computers with the Windows operating system installed. PC gaming reportedly only constitutes about 20% of the game market, so since MDX cannot be used on game consoles, it isn't an interesting platform for big gaming companies. As of February 2006 however, Microsoft announced that the current MDX2.0 beta release will be converted to the XNA Framework, which can be used to deploy games on both Windows PCs and the XBox360, openening up the console market for MDX games.
To recap, Managed DirectX is...
- A functionally equivalent wrapper around the normal DirectX API for .NET
- Providing very good performance while offering the productivity gain of coding in .NET
- On its way to becoming a prime game development platform, with the recent XNA
announcement and the general Microsoft push toward .NET
So, what do I need?
To get started with MDX development, you'll first need an IDE to do your coding in. Since MDX is a Microsoft product, it makes most sense to just use Visual Studio for your MDX programming. You can use MDX with both Visual Studio 2003 and 2005 (so both on .NET 1.1 and .NET 2.0). If you don't have Visual Studio yet, you can use the freely available Visual Studio Express For Windows Development. On the Visual Studio Express page you can also find information on how to get started with coding on the .NET platform.
So, now that we're ready to start coding in .NET, you should download and install the latest DirectX SDK, which is also freely available on MSDN, along with various resources on getting started. To be sure, you should install the SDK after you've installed Visual Studio, since it adds some functionality and settings to the IDE to make coding easier.
Once you have both Visual Studio and the SDK installed, you're ready to start coding your games. To run the code on another machine, it will need to have the latest DirectX Runtime installed and the .NET Framework runtime. You can manually install these runtimes on the target machine using the supplied redistributal installers, or you can point people to the DirectX Web Updater and use ClickOnce for deployment.
How do I get started coding?
We provide various resources on getting started with coding in Managed DirectX, ranging from background information to various tutorials on getting things done. Below you'll find a listing of the available resources and how they can help you on your way to learning Managed DirectX.
- Managed DirectX Hotlabs
The Managed DirectX Hotlabs are training sessions by MVP Pieter Germishuys that are held in Durban, South-Africa. On this page you'll find the powerpoint presentations and MDX sample code for these sessions, which provide a good background on the DirectX platform and show how to set up Managed DirectX and work towards coding clones of various well-known games.
- MDXInfo Basics tutorials
These tutorials provide more in-depth information to setting up DirectX and how to render various simple scenes with this setup. It has recently come to our attention that the tutorial texts and the code have gotten a bit out of sync because of updates to the code, but we are working to correct this asap. Still, the current tutorials and code should provide a good starting point on getting some MDX coding done.
- Book - Managed DirectX Kickstart
This book written by Tom Miller (who wrote the MDX API) provides a solid introduction to coding MDX applications and provides numerous code samples on how to get things done with MDX. The accompanying source code is a bit outdated, but you can find the updated sources over here at TheZBuffer, who also provides information on other MDX books.
Where do I go from here?
Though this does depend on where you want to go, the best way to learn MDX is to just pick a game you want to make and try to implement it to the best of your abilities. You'll undoubtedly run into some problems along the way, but this really is the only way to get comfortable with MDX (and game coding in general). Explaining common pitfalls and giving general advice is mostly confusing if you haven't experienced those issues yourself yet, so the best advice is just to get busy coding your game.
This doesn't mean you'll have to figure out everything yourself once you've reached this point. MDXInfo provides numerous resources on how to implement specific effects in MDX and how to optimize the performance of your application. Once you're wondering on how to implement a specific feature, check out our resources section or the other parts of our tutorial section and chances are we have the example you are looking for.
There are a few generic pointers we can give you how to get on in the MDX world though, which you'll find below.
- MDXInfo source code releases
You can learn a lot by reading the code of others and checking out how they've implemented various features in their games. To this end, we made the source code to a few simple games available in this section of MDXInfo.
- Game programming & MDX community links
Finding yourself a community that can answer your questions can be a big help in getting along in (game) programming. On this page you'll find links to various forums, discussion groups and IRC channels, where you can find people that can help you solve the problems you may run into.
