Jump to content
  • Advertisement
Sign in to follow this  
BinaryHead

C# Game Development - OpenGL VS. DirectX

This topic is 4719 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

Hi, Im a C# programmer and I´ve been thinking too long about making games...time to make it a reality :-) For that matter, I´m thinking if I should use OpenGL or DirectX? I´ve found many OpenGL books (with high ratings) on Amazon, but they teach mainly in C++. I´ve found only one book on amazon that teaches C# game development, and that´s with DirectX (not that good ratings) http://www.amazon.com/exec/obidos/ASIN/0672326612/qid%3D1119272662/sr%3D11-1/ref%3Dsr%5F11%5F1/103-5280700-8876641 Would you recommend that I use the OpenGL books and simply change the c++ code to c# to run the examples?

Share this post


Link to post
Share on other sites
Advertisement
If you feel comfortable with using C++ samples to learn and write your own C# code, then feel free to use OpenGL. If you'd prefer your examples be in the language you're using, then use DirectX.

Both are very good APIs, so as long as you're capable of porting the samples theres no particular reason to choose either over the other. If you want cross-platform code you'll probably want to consider OpenGL, and you should also keep in mind that DirectX has more than just DirectGraphics.

Share this post


Link to post
Share on other sites

I´ve heard that pro games (Such as EVE Online) are developed using C++ and Python.

I have some C++ experience, but never did anything in Python. However Im best in C#, so that would be my nr.1 pick :-)

Im just still a little confused if I should use OpenGL or DirectX. I´ve seen more books on OpenGL so Im leaning towards OpenGL. Any reason why I shouldn´t?

Share this post


Link to post
Share on other sites
If you're comfortable with choosing OpenGL then that's perfectly fine. It's a good API, theres plenty of reference material, and it's been used in a lot of projects, so it's well proven.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kazgoroth
If you're comfortable with choosing OpenGL then that's perfectly fine. It's a good API, theres plenty of reference material, and it's been used in a lot of projects, so it's well proven.

Actually no OpenGL hasn't been used in what I would call a lot of projects when we are talking about managed code. You have to use a wrapper library such as Tao.OpenGL so the reference material is there but not exact.

With C# I would definately go with managed DirectX for a graphics API. I mean Microsoft has spent a lot of time making it a really nice API, and it fits with the C# coding style where OpenGL is more C-style.

Quote:
Original post by BinaryHead
Would you recommend that I use the OpenGL books and simply change the c++ code to c# to run the examples?

You'll be doing a lot more than just changing a little C++ code to C# to run the examples, as you'll need to use a managed GL wrapper and than change all of the API calls to use the wrapper calls. I am not saying this is an impossible feat or anything, just that it isn't something you will do in 30 seconds.

Also this is the best book on developing with managed DirectX using C#.

Share this post


Link to post
Share on other sites
Quote:
Original post by Saruman
Actually no OpenGL hasn't been used in what I would call a lot of projects when we are talking about managed code. You have to use a wrapper library such as Tao.OpenGL so the reference material is there but not exact.


Excellent point. I completely miss it every time due to not having used managed code myself at all - must remember to take that into consideration.

Share this post


Link to post
Share on other sites
I'd second the Managed DirectX suggestion. Tao is a nice wrapper but the amount of time the MS team spent optimizing managed directx is far more valuable. It also has actually examples in the SDK and has been used in complete games.

Share this post


Link to post
Share on other sites
The added benefit of using managed C# and Direct3D, is that if the client has already installed DX9.0c then it already comes with the .NET managed runtimes (there's no "extra" install)..

Share this post


Link to post
Share on other sites
I third the recommendation for using MDX if you're using C#. There really isn't any way to deploy a C# gaming application on anything other than Windows, so the "portability" argument for OpenGL goes out the window. Meanwhile, the support you get through OpenGL inside .NET is significantly poorer than what you get from MDX.

Don't get me wrong; I like OpenGL, and if you were developing in C or C++, I'd suggest OpenGL, but for .NET, use MDX.

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
I third the recommendation for using MDX if you're using C#. There really isn't any way to deploy a C# gaming application on anything other than Windows, so the "portability" argument for OpenGL goes out the window. Meanwhile, the support you get through OpenGL inside .NET is significantly poorer than what you get from MDX.

Don't get me wrong; I like OpenGL, and if you were developing in C or C++, I'd suggest OpenGL, but for .NET, use MDX.

Why do you say this? I was contemplating trying my hands at making a "write once, run everywhere" game with C#, TAO.OpenGL, and SDL.Net. Tao's website was down last time I checked, is it bound to Windows? Otherwise, couldn't someone with Mono installed run a game made with these technologies on basically any modern day machine? (This is just a topic that interests me. I would love if I could write fully portable code, including games, without really trying to.)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!