A comparison of graphics libraries and their respective programming languages.

Started by
9 comments, last by Hodgman 12 years, 3 months ago
A comparison of graphics libraries and their respective programming languages. A.K.A. "Which do I pick? With a twist."

I'm a long time professional programmer who never gave up on programming as a hobby. 3D programming has always appealed to me, but after some trial and error I always came back to (and got stuck on) the same question:

Which to choose?

  • C# with XNA.
  • C++ with DirectX.
  • Java with OpenGL.


All three appeal to me:

  • XNA, because it's managed, of high quality and very complete.
  • DirectX, because it's de facto standard for large games.
  • OpenGL, because it's open. It has a proven track record of high quality games built using it. + Eclipse hotswap functionality is sexy.


Keep in mind here that I will:

  • Use the above library and language for hobby use.
  • Will want to develop both 3D games and 3D tooling.
  • Might seek a job in a 3D programming industry.


For the sake of the argument, assume I am equally well versed in C#, C++ and Java. And have no preference for any of the three mentioned libraries. In reality I have a slight preference for one of those three, but the quality of the code I produce in the languages is the same.

Replies with sources as links are preferred! OGRE and Irrlicht (and similar) are also contenders, but not preferred because it introduces additional depencies on other developers.



I've posted the same question on:
- gamedev.stackexchange, where it was quickly closed. http://gamedev.stack...mming-languages
- r/gamedev, who were generally uninterested. http://www.reddit.co...hics_libraries/
Advertisement
Well I think part of the problem is, you are asking an unanswerable question and too boot, you want to compare apples to zebras.


You are doing it backward, that's why it isn't done that way.


First you need to determine which Platforms you want to support. That narrows your list down substantially.
Then you need to determine which feature sets you require, which again will narrow things down.
Then you need to determine which prgoramming language to use, which narrows it down again.
Engine or framework?
Open source or closed?
Free or licensed?
Finally, flip a coin and pick from the remaining items.

This guide may help you , it doesn't compare the languages and libraries against each other, but does speak to the strengths and weaknesses of each language and the libraries that work with them.

Finally, you aren't going to be doing Java +OpenGL, you will be using a library such as Jogl or lwjgl, or an engine like jMonkeyEngine. Again, all of those options are discussed in that link.
[color=#333333]If I were you, I'd take the time and learn OpenGL, particularly since you're a dedicated hobbyist at this stage. Like C and C++, it's a general-purpose tool that sets you up for opportunities in different industries, if it ever interests you to do 3D programming for eg. medical visualisation or defence contracting. They say that DirectX is a short leap from OpenGL. Also, I would say you can get into GPGPU technologies like OpenCL or Nvidia CUDA more easily if you take this route. And IMO, that's where the future is: General purpose, massively parallel processing without restricted access to the bulk of system memory.

[color=#333333]So that's DirectX covered under that umbrella, as well. I would favour it only slightly less than OpenGL, but that's very much a personal preference. It's still miles ahead of the remaining alternatives.

[color=#333333]For the above reasons and more, I wouldn't choose XNA. I find the framework restrictive and to me at least, the architecture desicions they took don't make much sense. Yes, I know it's great to be able to deploy for Windows and XBox360 at the same time. Yes I know C# 4.0 is (let's be fair) a great language in many ways. XNA may save you time. But I'd still avoid it unless I was specifically targetting the Xbox360 for a game that didn't require the degree of control that a lower level language offers.

[color=#333333]To be fair, if you are not already a C or C++ programmer (you don't specify), I would certainly go the Java and OpenGL route. Notch, of Minecraft fame, has made a huge name for himself with those two technologies as an indie and I don't think that is something to sneeze at. I used Java briefly last year and in comparison to C#, it may have less modern features, but the consistency and simplicity of the core libraries are just brilliant. Java collections are an absolute pleasure, more than any other language I've worked with. And they support just about any type of collection you can think of, natively. And they're FAST.

[color=#333333]You did leave out one popular option, which is Unity. This is ideal if you want a really, really fast start. The basic edition is free, and you can use DropBox for source control (since unless you pay for version control support otherwise, it can be problematic). It uses Mono C#, although not the newest version.

I used Java briefly last year and in comparison to C#, it may have less modern features, but the consistency and simplicity of the core libraries are just brilliant.


The Java standard library is neither consistent nor simple.


For the OP, just pick one and go. C# and SlimDx is my personal preference.
^what Seraph said.

But quite frankly, assuming you are on Windows, just pick one of the above and run with it (though, might I suggest C# + SlimDX as an option). Once you are familiar with the concepts/etc. you will be able to switch between all of the above with minimal effort, so the important thing is to leap into whichever one, and get some experience.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

I don't have much to add to the above, but I wanted to reinforce the advice of "it doesn't matter -- just pick one and go with it".

All of the options you have listed are capable, and your stated goals and existing skill-set (as described) don't really push any to the fore-front either. Be sure to do as suggested above and eliminate any options that don't support target platforms or lack capabilities you desire, but other than that you really just need to pick any option and get started with it. The worst thing you could do is spend too long trying to find a "best" option when you could already be making significant progress.


My personal preference of your listed choices would be C# with XNA, largely for the reasons you mentioned yourself -- additionally it's well supported and has some excellent documentation and resources available.

- Jason Astle-Adams

If you want a job in the 3D industry, then what's important is learning the concepts behind those libraries -- the concepts can be learned on any of those, and will 90% transition over to any other graphics library. Choose the one who's documentation clicks the best with you wink.png
After you've learned one of them, you will be able to use any of the others with minimal effort/re-learning.
OpenGL, because it's open.
I'm not sure what you mean by this... sure it's got "open" in the name, but I can't look at it's source code, and I certainly can't make my own implementation (and refer to it as an "OpenGL implementation") without paying licensing fees.

Also, you can go with C++ and GL, or Java and D3D, or C++/CLI and XNA, or C# and D3D, or C# and GL ;)

A comparison of graphics libraries and their respective programming languages. A.K.A. "Which do I pick? With a twist."

I'm a long time professional programmer who never gave up on programming as a hobby. 3D programming has always appealed to me, but after some trial and error I always came back to (and got stuck on) the same question:

Which to choose?

  • C# with XNA.
  • C++ with DirectX.
  • Java with OpenGL.



Your assumptions here are wrong OpenGL, DX and XNA are programming API's and aren't really bound to a language, especially the OpenGL and DX cases are wrong. I can use both in C/C++, Java and C# for example, but I know of bindings for delphi as well. Graphics API's are just API's like the windows one, you might want to learn more about the mathematics involved in graphics as these apply to all API's and is the skillset you actually need.

If you are looking for a job in the games industry as a programmer your best bet is to go with C/C++ and DX or OpenGL. Going for a tools job go with C# although there are a few tools still out there written in C/C++ so knowledge of the language is still nessecary.
Middleware tools are still mostly written in C/C++ but it all depends on the tool and the company thats making it.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

This thread is answered. I did not quite get the answer I had hoped for, but I realize that there aren't a lot of people coming from my situation (being a professional programmer before learning 3D programming). A comparison of graphics libraries and their respective programming languages can't be found in this thread. The guide that Seraph posted goes on lengths about choice of language and only touches the libraries briefly.

I will take your wisdom, 'flip a coin' and choose Java/OpenGL for now. The answers provided here set me on the path to eventually being able to answer this question myself.

This thread is answered. I did not quite get the answer I had hoped for, but I realize that there aren't a lot of people coming from my situation (being a professional programmer before learning 3D programming). A comparison of graphics libraries and their respective programming languages can't be found in this thread. The guide that Seraph posted goes on lengths about choice of language and only touches the libraries briefly.

I will take your wisdom, 'flip a coin' and choose Java/OpenGL for now. The answers provided here set me on the path to eventually being able to answer this question myself.

Thats because the answer you are looking for doesn't exist, once you understand the maths behind 3D graphics, picking up an API is the easy part. DX has a steeper learning curve than GL but it plateaus quickly, GL doesn't make you focus on what the hardware is capable of immediately. The DX and GL API's in what they can do are so close at the moment that it doesn't really matter which one you pick, the XNA one lags a bit due to it having to have to support WP7 and X360 which are only DX9.0 capable devices (I know 360 is a bit more powerful). During the early 2000 DX had a clear advantage over GL (vertex buffers, render targets and stuff like that) that has disappeared now, as nearly everything is done in shaders and they have their own programming language.
I would recommend you learn CG over GLSL however as your shader language as it supports both GL and DX, whereas GLSL doesn't and deviates from CG and HLSL. HLSL is based on CG anyway so for all practical matters they are the same. With the current gen of GPU's the API you use matters less as you will do most of your effects in shaders anyway.
And the DX effect file is just a file format that makes it easier to compile and link the shaders for the runtime it is nothing more then that.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

This topic is closed to new replies.

Advertisement