OpenGL or DirectX?

Started by
22 comments, last by Kylotan 16 years, 10 months ago
Hello mates If I want to start programming 3D-games, which enging is to prefer then? OpenGL or DirectX? And maybe anyone can recommend one or several GOOD books? Thanks
Advertisement
I'm pretty sure an FAQ around here answers this question in detail. It might be the For Beginner's one. Anyhow, the answer is that it doesn't really matter unless you plan on programming for Linux or Mac, in which case use OpenGL. otherwise, it's pretty arbitrary. OpenGL is generally considered a tad easier to learn, but overall they're going to be roughly the same amount of work for the same amount of results. And they both have plenty of good information regarding them, so that's pretty fair too. It comes down to choice or platforms.

Oh, and about the books. Beginning OpenGL Game Programming is excellent. This is assuming that you already have a firm grip on C++. If not, work on that first (or work on the language of your choice, all major languages have OpenGL bindings).
I would recommend OpenGL, if only because of it's universality (compared to DirectX) and it's open-source nature. I am personally a big fan of open-source programs and APIs, and I love OpenGL.

And if you're looking for OpenGL help, try the Redbook. It's available at http://www.glprogramming.com/red/ .
Quote:
I would recommend OpenGL, if only because of ... it's open-source nature.

OpenGL is not open source. It's a standard, which is freely available, however to claim that OpenGL is open source implies that the source code to the implementation must be available. It's not.

That said, to the OP: Look at them both, pick the one you like best. They both do the same thing, in the end, there is really little difference that you need to be worried about at this point in your career.

Quote:
And maybe anyone can recommend one or several GOOD books?

Avoid books that cater to specific APIs (unless they're free, like the OpenGL Red Book) as they become outdated quickly and aren't worth the money. Avoid books that claim to teach you "beginning game programming" in a specific API.

I generally recommend people acquire "Fundamentals of Computer Graphics, 2nd Ed." and possibly also "The Geometry Toolbox" (understanding the math is critical to writing nontrivial 3D applications) to get a solid understand of the API-agnostic theory. That theory can be supplemented with the excellent online documentation available for either OpenGL or D3D.
I'd also like to pipe in and recommend the book Realtime Rendering 2nd Edition :)
In my opinion I think DirectX is more complex than OpenGL. DirectX have many different versions(I mean that there is 7.x, 8.x or 9.x, etc...) and it's built upon you have to create object devices (tag struct's). But in OpenGL there's just one main version of it, it's basically just global function calls except for some objects.
Quote:Original post by CodeMachine
Hello mates

If I want to start programming 3D-games, which enging
is to prefer then? OpenGL or DirectX?

And maybe anyone can recommend one or several GOOD books?

Thanks


I might add that it's not entirely necessary to even make this decision, if you go with the option of using an already-heavily-developed graphics library like CrystalSpace, Irrlicht, or my own personal favorite, Ogre3D, you can bypass much of the 'graphics engine' development part of your game's progress (as well as some other components which those libraries offer you), in the name of focusing on game elements instead.

Best of luck,




Quote:Original post by jpetrie
Quote:
I would recommend OpenGL, if only because of ... it's open-source nature.

OpenGL is not open source. It's a standard, which is freely available, however to claim that OpenGL is open source implies that the source code to the implementation must be available. It's not.


Let me correct you:

- Mesa 3d - linux opengl implementation of opengl is opensource..
- SGI offers a opengl reference software implementation under opensource license as well.

Projects: Top Down City: http://mathpudding.com/

Quote:
Let me correct you:

- Mesa 3d - linux opengl implementation of opengl is opensource..
- SGI offers a opengl reference software implementation under opensource license as well.


That's worth mentioning, of course, but that isn't a "correction" to what I said. Those are implementations of OpenGL. Not OpenGL itself. I can write an implementation that conforms to the Direct3D interface and make that open source, but that does not make Direct3D itself open source.

OpenGL is a standard, and that standard does not stipulate that an OpenGL implementation must be open source. Consequently, OpenGL is not open source. You won't find the source to Microsoft's implementation, for example. When people talk about OpenGL, they usually mean any or all implementations of the OpenGL standard (it's kind of nonsensical to call a standard "open source," after all). But there is no stipulation that all implementations must be open source (many are not) and it is therefore inaccurate to claim that OpenGL is open source. I never said anything about particular implementations, after all (although the implementations that will be used by the majority of the game-playing market will be closed source).
Check this out: http://www.xmission.com/~legalize/d3d-vs-opengl.html

This topic is closed to new replies.

Advertisement