4
\$\begingroup\$

I thought that if you wanted to make games using DirectX, you had to know C++. But I recently found out that that is not actually true. It looks like some parts of Direct3D can be used from C#. This MSDN document, for example, which has C# examples.

Am I understanding this incorrectly? Have I waited all these years for nothing?

\$\endgroup\$
0
8
\$\begingroup\$

Yes, there are DirectX bindings for C#. This has been available for almost 10 years or more.

XNA (announced 2004), MonoGame (announced 2009), SharpDX and more all provide you the ability to access DirectX using C#. You actually only need to Google "C# DirectX" and you'll find plenty resources on this. The MSDN documents you are link to in your question, however, are referencing Microsoft's own "Managed DirectX," which is now deprecated and not a viable choice for new development.

Additionally, you only need to look a little further into link you provided to find sample projects you can use with the Direct3D API.

\$\endgroup\$
8
  • \$\begingroup\$ Okay thanks I got that. But that is not exactly answers my question. When I see the Direct3D c# examples I thought I can use Direct3D in my C# projects without using any third party library like SharpDX. \$\endgroup\$ – Semih Masat Sep 29 '13 at 15:50
  • 1
    \$\begingroup\$ I'd say SharpDX is the closest to what is being asked. XNA and MonoGame do not allow the user to directly call DirectX, as far as I know. \$\endgroup\$ – luiscubal Sep 29 '13 at 15:50
  • \$\begingroup\$ I was making it clear that there is plenty of evidence to the contrary of "I thought if you want to make games using DirectX , you had to know C++". I've updated the answer to include a link to the Direct3D API where you can get some sample projects. \$\endgroup\$ – MichaelHouse Sep 29 '13 at 15:56
  • 2
    \$\begingroup\$ @SemihMasat Those MSDN pages you linked to are old, and refer to Microsoft's "Managed DirectX," which is deprecated and no longer viable for use. All it did was exactly the same thing SlimDX or SharpDX do anyway: provide P/Invoke-based or C++/CLI-based wrapper bindings for the C or C++ DirectX APIs. \$\endgroup\$ – user1430 Sep 29 '13 at 15:59
  • \$\begingroup\$ Thank you. I know I sound like complete noob. But when ask people, they always said, "no you cannot use directX with c#" . But looks like I can use Direct3D API. Maybe I am understanding this all wrong. \$\endgroup\$ – Semih Masat Sep 29 '13 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.