Jump to content
  • Advertisement
Sign in to follow this  
EmperorXYZ

Is it a good idea to use both C# and C++ with DirectX

This topic is 2502 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Reason for asking: I've recently learned C# and really like it. It's just that I've been able to find ressources explaining well the BLC. I'm sure C++ also have similar libraries, but from how difficult it was for me to start learning Boost, I'd rather use C#.

So, I was wondering if that would be a good idea or there are hidden reasons, such as performance issues or lack of compatibility. I was planning on using C++ DLLs to make DirectX calls and use C# for game logic and pretty much everything else.

Share this post


Link to post
Share on other sites
Advertisement
You don't need to learn or use Boost for C++. Personally I don't think it provides anything useful.

C# isn't much slower than C++ as far as I know. There's no need to create C++ library either, you could use something like XNA (http://create.msdn.com/en-US/), and I'm sure C# has a way to use DirectX (I'm not using it, so I do not know how to do that).

Share this post


Link to post
Share on other sites
Yes, you can mix C# and C++. They are compiled into object files and you can link them together however you please.

There is no reason to just use C++ as a wrapper. Not only do you have XNA, but there are other projects like SlimDX that already handle it for you.

Share this post


Link to post
Share on other sites
Interop between C# and C++ can be a major pain in the ass, and I don't suggest putting yourself through it if you don't have to. Libraries like SlimDX and SharpDX have already done all of the hard work of wrapping DX, so if that's your goal then you should consider using those instead.

Share this post


Link to post
Share on other sites
I see thanks. Well, I'm still at the learning phase and I'd like to write a project or two where I'd have to go fairly low level with DirectX. After that, I'm all for less painful code writting. I'll check out SlimDX, SharpDX or XNA once I have a fairly solid grasp on how DX works. I'm also wondering about DXUT as even if I'm writting a complete C++ project, I still want shortcuts.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!