DirectX or OpenGL

Started by
6 comments, last by GamerSg 13 years, 7 months ago
For Someone with 5 years experience in C++ but ZERO in 3d/game programming but wanting to really hit the pavement running with it, what would be the best bet to start?

OpenGL or DirectX?

I've heard OpenGL is easier to understand......but you can't advance as far in it. However MS keeps changing stuff with DX 9,10,11 so i'd probably have to PICK one.

Suggestions?

Thanks guy/gals
Advertisement
Quote:Original post by MercenaryFH
I've heard OpenGL is easier to understand...
OpenGL still has some old functions which make it easy to get up and running, and drawing simple triangles.
These functions are deprecated though and shouldn't be used outside of "beginner" code.
Quote:...but you can't advance as far in it.
Nope, they're pretty much equivalent.
So which would you suggest? if I were to be starting like now?
I'd suggest OpenGL. If only because of the growing mobile market that uses variants of OpenGl ES for graphical display. I don't really keep up with any DirectX stuff at all. Last I read one of the OpenGl vs DirectX flame-wars, it seemed that OpenGL was still supported directly on more platforms.

I'd also suggest you just look at something higher up, like Ogre, SDL, Irilich, etc.

*OpenGL ES isn't exactly the same as OpenGL 3, but it is very close.
As a programming model, I prefer by far programming with DirectX. It's all object-oriented, versus functions and handles for OpenGL. DirectX is also a multimedia package so you get input, audio and network gameplay in one package. The DirectX SDK also comes with tons of samples and tools.

OpenGL is cross-platform, but you still have to write platform-specific code to initialize the windows, unless you use SDL or something. Also, on Microsoft Windows, support is lacking for certain video cards. For example, after I changed a toasted video card on my old computer, I could not set any blending mode other then add and alpha, as the ARB_IMAGING extension was not present. Yet, DirectX supported it just fine. And even with the old video card that supported it, I had to use some "GLew" library just to be able to call the functions on Windows.

The best, if you're really serious about making games, would be to implement both (via a set of abstract classes using polymorphism to call either the GL or DirectX implementation) so you can use the good stuff on Windows, but if you have to pick only one, I would say go with OpenGL. The sales numbers of Mac computers is exploding with the success of Apple these lastest years, not to mention more and more cellphones being capable of running games, so being able to program on both platforms is bound to be important in the future.
The other folks have hit on most of the bigger points, but I'll also add that, on top of widespread adoption of OpenGL|ES in the mobile industry, OpenGL is also the basis for cross-platform, sans-plugin 3D in the web browser, known as WebGL.

If you're interested in doing 3D in the browser, and you're not partial to plugins like Flash or Silverlight (both of which are promising 3D support soon -- Flash with... who knows what, Silverlight with, probably, XNA) then OpenGL gives you coverage in that arena too. Its already very capable in development builds of most popular browsers (another forum goer showed of his quake 3 level viewer in WebGL, and I got over 300fps under chrome -- and my PC is a fairly average gaming Rig, Even my Macbook was hitting 130fps in most scenes) and while there's no existing marketplace for HTML5/WebGL games right now, the technology is certainly up to snuff. I believe it is only a matter of time before the marketplace begins to catch up, and this is a very interesting space to be in indeed.

throw table_exception("(? ???)? ? ???");

Thanks a ton guys, that really helps. I think as where im starting OPENGL might be a better thing to program in. Too bad iphones sdk is java right? which I know nothing about. Although it would be neat as heck to make a little game for iphone or something
IPhone explicitly does not allow Java on it. The only "Legal" languages on iPhone are C/C++/Objective C of which >70% of the iOS API is exposed in Objective-C with the rest in C. Though i would not call the iPhone an easy platform to program for, it is very very well documented with plenty of examples, so it is quite doable once you get past the Objective-C syntax to atleast use the API.

And for graphics, it uses OpenGL ES which is a almost like an exact copy of OpenGL3 with some features removed. Ive found that 90% of my OpenGL code can be copy-pasted to work on iPhone with some very minor changes(remove EXT post-fix, etc..)

This topic is closed to new replies.

Advertisement