Over a million developers have joined DZone.

.NET Zone SharpDX - A new Managed DirectX/Multimedia API Library (one with Win8/Metro in mind too!)



"SharpDX is a full DirectX framework for the .NET Platform, including the newest DirectX technology. The top three features of SharpDX:

  • SharpDX is providing the latest DirectX and Multimedia API to .Net with true AnyCpu assemblies, running on .Net and Mono.
  • SharpDX is ready for next generation DirectX 11.1 technology and Windows 8 Platform. You can start to develop DirectX Metro style App in C# under Win8!
  • SharpDX is the fastest Managed-DirectX implementation.

SharpDX is using a custom code generator from C++ headers in order to generate an efficient .Net interoperability with C++ DirectX API.



The key features and benefits of this API are:

  • Support for the following DirectX API:
    • Direct3D9 & Ex
    • Direct3D10
    • Direct3D10.1
    • Direct3D11 and Effects11
    • Direct3D11.1 (Win8 only)
    • Direct2D1 (including custom rendering, tessellation callbacks)
    • Direct2D1.1 (Win8 only)
    • DirectCompute
    • DirectWrite (including custom client callbacks)
    • D3DCompiler
    • DXGI
    • DXGI 1.1
    • DXGI 1.2 (Win8 only)
    • DirectInput 8
    • XInput
    • RawInput
    • DirectSound 8
    • X3DAudio
    • XACT3
    • XAudio2
    • XAPO
    • WIC
  • API is generated from DirectX SDK headers : meaning a complete and reliable API and an easy support for future API.
  • Managed platform independent .NET API : assemblies are compiled with AnyCpu target. You can run your code on a x64 or a x86 machine with the same assemblies, without recompiling your project.
  • Lightweight individual assemblies : a core assembly - SharpDX - containing common classes and an assembly for each subgroup API (Direct3D10, Direct3D11, DXGI, D3DCompiler...etc.). Assemblies are also lightweight.
  • Fast Interop : the framework is using a genuine way to avoid any C++/CLI while still achieving better performance than existing managed API. Check this benchmark.
  • API naming convention mostly compatible with SlimDX API.
  • Raw DirectX object life management : No overhead of ObjectTable or RCW mechanism, the API is using direct native management with classic COM method "Release".
  • Easily mergeable / obfuscatable : If you need to obfuscate SharpDX assemblies, they are easily obfusctable due to the fact the framework is not using any mixed assemblies. You can also merge SharpDX assemblies into a single exe using with tool like ILMerge.
  • Easily deployable as SharpDX are plain .NET assemblies, there is no need to install VC runtime or .NET GAC install.
  • An integrated math API directly ported from SlimMath


I like the approach this project takes in that it's a pretty slim wrapper for the DirectX API, that's its foundation is tight coupling to he C++ headers.


Published at DZone with permission of Greg Duncan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}