Main Page
From SlimDX Wiki
Welcome to the SlimDX Wiki!
SlimDX June 2008 has been released!
This wiki exists to serve as a source of high level documentation and discussion for SlimDX. This site is still under construction, so please excuse any rough edges or omissions.
All development is based in our Google Code homepage. You can use that site to report bugs (using our issues page), as well as download binary releases or a complete copy of the source code. If you have questions to ask, or otherwise wish to discuss SlimDX, we ask that you use the DirectX forum on GameDev.Net. This is the only forum on which the developers are active; we do not use any other forums or mailing lists. Please prefix your thread subject with [SlimDX] if the question is reasonably specific to SlimDX. If it isn't, feel free to include or exclude the prefix as you like. Lastly, you can try and get a hold of us on IRC, in the #graphicsdev channel on irc.afternet.org. The discussion pages in this Wiki should only be used for discussion of the documentation, rather than SlimDX itself.
The following pages may serve as a useful starting point for exploration:
None of this could exist without the support of other developers, so thank you all. In particular, I owe a drink to Rim van Wersch, who is hosting this site, and did the sleek logo for us. Mike Popoloski has been a huge help in both development of the library itself and the maintenance of this wiki, and Josh Petrie's work on the library has helped expand its scope to what it is today.
Lastly, if you're using SlimDX, please let us know! There's no obligation, but we'd love to find out who is benefiting from all of our hard work. Just add yourself to Projects Using SlimDX, and feel free to include a brief synopsis of your project or a link to a homepage.
Contents |
What is SlimDX?
SlimDX is a library originally prototyped by Promit Roy which allows .NET 2.0 applications to use Microsoft's DirectX APIs, as well as several related Microsoft APIs that share similar goals. This role was previously filled for .NET 1.1 applications by Microsoft's own Managed DirectX (MDX) library. However, the age of .NET 1.1, plus Microsoft's lack of interest in continuing MDX has made it necessary to build a new library. Thanks to enthusiastic community support and the invaluable contributions of several other developers who have worked on and with SlimDX, the library has made immense strides towards being a fully viable platform on which to build DirectX based applications. SlimDX is no longer a beta and is considered stable!
In addition, SlimDX is open source software, and the complete source code is available to anybody under the MIT/X11 license. Right now we do not offer a downloadable archive of the source code, but you can use a Subversion client to download the source. We recommend TortoiseSVN for this purpose, but any Subversion client will work just as well.
What is the current status of SlimDX?
SlimDX was first publically revealed on June 30, 2007. It has grown explosively since then, with a number of new developers signing up to develop and test. As of the June 2008 release, it is no longer in beta and is considered stable. The best way to monitor SlimDX's progress is to keep an eye on the Release Notes page.
The following APIs are completely supported by SlimDX:
- Direct3D 9
- Direct3D 10
- DXGI
- DirectInput
- XInput
- Raw input
- XAudio 2
- X3DAudio
- DirectSound
Why not use Managed DirectX?
Managed DirectX is still usable, even with .NET 2.0 applications. However, there are a number of problems affecting MDX that make developing applications on it undesirable.
- MDX is no longer in active development, but is frozen in its current state. What that means is that no more new features are being added, and what bugs remain are probably not being fixed either. Although Microsoft provides a 5 year support cycle for deprecated libraries, this support is minimal and not especially useful.
- Microsoft's focus on XNA has completely supplanted any efforts to maintain MDX. In particular, it was announced with the August 2007 update of the DirectX SDK that all MDX samples and documentation are being discontinued permanently.
- MDX does not and will never support any new APIs. This means that several important new APIs are not accessible to .NET applications, including Direct3D 10, XInput, and XAudio 2.
- MDX provided a lot of extra functionality, and some of this functionality could create unintended side effects. The event system is a good example. Applications which accidentally leaked lots of objects would grind to a halt due to the events, as MDX attempted to clean up after itself.
- The lack of support for .NET 2.0 functionality, especially generics, means that the MDX interface is quite akward in places. This issue had already been addressed by the MDX 2.0 beta, but that beta was discontinued permanently and can no longer be used.
- The LoaderLock exception is a minor, but worrisome thorn in the side. Basically, there were some mistakes in the design of Managed C++ in .NET 1.1 that introduced the danger of non deterministic deadlocks when an assembly is loaded. Visual Studio 2005 detects this condition and creates an exception to warn of it. This exception can be disabled on a per project basis, apparently without ill effect. However, there is no evidence that this deadlock risk does not exist in all applications using MDX.
Why not use XNA Game Studio?
XNA Game Studio (XNA GS) is Microsoft's new initiative for game development in .NET applications. It is mostly source compatible between both Windows and Xbox 360 platforms. Note that "XNA" is used as shorthand for the XNA Framework.
- XNA is first and foremost an Xbox API. This is an unavoidable consequence of the decision to make applications using XNA source compatible across both Windows and the Xbox. Naturally, the console is the more limiting of the two in its capabilities, and those limitations are carried over into XNA and affect all XNA based applications.
- Since XNA does not support libraries that are not compatible with the Xbox, developers are forced to use other libraries if they wish to use other functionality under Windows. For example, there is no low level audio API in XNA, so in order to do low level audio work, you must use Managed DirectX to access DirectSound. There is also no support for controller devices that are not XInput compliant, and most are not. (Only Xbox 360 peripherals are.)
- The primary sound library in XNA, called XACT, is not particularly good. It's a half baked port from the Xbox version, and only exists as a stop gap until the XAudio 2 library is ready to use. XAudio 2 will be in beta until March 2008, and will only be integrated into XNA after that. XACT is a high level library that does not support any sort of custom sound codecs. No Speex, no Ogg Vorbis, no MP3. In fact, all it does support under Windows is PCM and ADPCM data. ADPCM only offers a maximum compression ratio of 4:1, which means that a five minute long audio file will typically take around 25 MB of disk space.
- XNA does not have any Direct3D 10 support, and it seems unlikely that support will ever be added. As a result, it's impossible to develop cutting edge graphical applications on top of XNA's graphics API. This situation can only get worse, as new versions of Direct3D are released.
- On the opposite end of the spectrum, XNA does not support the fixed function pipeline. For games that wish to run on hardware predating shaders (common in the indie market), XNA is unusable.
- XNA is difficult (though not impossible) to interface cleanly with a normal Windows interface, which makes authoring tools an akward experience at best.
- XNA does not expose its internal pointers, nor does it allow construction of objects from native pointers. This makes it impossible to make XNA interoperate with other libraries such as DirectShow, or native C/C++ code.
- XNA GS is not currently compatible with Visual Studio 2008, so you are forced to use 2005 to do any XNA development.
Why not use SlimDX?
SlimDX isn't for everyone. While we've done our best to build a great library, that doesn't mean that SlimDX is the appropriate choice for your project. There are a number of reasons you might not want to use SlimDX:
- SlimDX is, as the name implies, a slim and simplistic wrapper on top of DirectX. XNA GS, in contrast, provides a lot of higher level functionality that keeps you from having to deal with very low level details. Overall, this means that XNA is a fair bit easier to use, especially for newbies who are not comfortable with how DirectX works.
- SlimDX is a relatively new API. Although for the most part it's very stable nowadays, once in a while we are forced to make a (usually minor) breaking change in how classes are organized or how functions are named.
- Because SlimDX is built by volunteers, we're always short of help. There's a lot of effort put into making sure that SlimDX is well written and bug free, but we simply don't have the resources that Microsoft does to verify and test that everything works the way it's supposed to.
- For much the same reasons, we don't have the kind of documentation that Managed DirectX or XNA does. We've been working hard on writing up complete documentation, but there's a long way to go and not nearly enough manpower. A lot of it is self explanatory to someone familiar with DirectX, but for someone less experienced, there's not much to go on.
- Managed DirectX and XNA both have a lot of third party tutorials and samples out there, written by people who are just helping out those communities. SlimDX does not enjoy such a community yet. Although MDX and SlimDX are similar, they're not the same API, and you can't just build any old MDX sample against SlimDX.
- SlimDX doesn't have any official support staff. While we're fairly easy to get a hold of, we're certainly not equipped to deal with major, time critical support needs like a company might have. If you absolutely need functionality added or bugs fixed quickly, you need to be able to do it yourself.
Who is using SlimDX?
Although the library is still fairly new on the scene, and doesn't have the name recognition of MDX or XNA, many developers are getting on board early. For a detailed list, check out Projects Using SlimDX.
