Starting OpenGL or DirectX soon. But which?

Started by
9 comments, last by Gage64 16 years, 3 months ago
I'm going to start learning a graphic API soon, but I haven't decided which one yet. From what I've found, people say OpenGL is easier to get started but DirectX is easier in the long run (I'm not sure about that). I've searched on amazon and here for books, and I've found these: They both got great reviews. (the DX one is a lot larger) Open GL: http://www.gamedev.net/columns/books/bookdetails.asp?productid=336&CategoryID=21 DirectX: http://www.amazon.com/Introduction-Game-Programming-Direct-9-0c/dp/1598220160/ref=pd_bbs_1?ie=UTF8&s=books&qid=1199489626&sr=8-1 Which one should I get? Thanks in advance. ps: Why aren't the url tags working?
Advertisement
See the Forum FAQ, "Asking Questions", question 8. Have a search on the forums and you'll come up with millions of threads on the subject.

Also, these forums don't use tags, they use HTML anchor tags.<br><br><br>EDIT: Also, you mean Direct<b>3D</b> vs OpenGL. DirectX consists of multiple components for input (eww), networking (Well, it used it), sound, graphics, and video.
Quote:Original post by sheep19
ps: Why aren't the url tags working?


<a href="link.htm"> Clicky </a>

Edit: What Evil Steve said.. :P
I'd recommend OpenGL due to DirectX being for windows only. As for one being easier than the other I'd say that since they do the same things they're about equally easy/hard.

Another good book for OpenGL is the Red Book (an old version is available for free online).

As for the url tags this forum uses normal html tags (see the faq).
personally i found Direct3D (DirectX Graphics if you wanna split hairs) to be easier to grasp due to the window management issue, as well as the fact that i was more comfortable with the online resources i found for it, although from what i understand, they're pretty much even when it comes to learning curve and ability
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
I'm going to second the vote for OpenGL because of portability, and with SDL the windowing issues are totally taken care of (and totally portable for that matter). So i guess really my vote goes to OpenGL + SDL.

But REALLY the right thing to do would be to try both, I started with Direct3D and tried OpenGL and liked it, and no doubt plenty of people have started with OpenGL and decided they liked Direct3D more, but like i said, if I had to pick one, I'd pick OpenGL hands down.

cheers
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Personally I've always felt that if portability is not a major concern then Direct3D is an easy win. I'm sure some of that is just my personal preference, but the main reason is D3DX. D3DX is a support library included with D3D that includes many functions and interfaces that can handle common graphics-related tasks. It can make your life much easier, especially as a beginner, as it allows you to focus more on the high-level concepts and less about whether your vector class is properly optimized or writing code to load a TGA file as a texture. OpenGL has no such library, and you must instead use third-party offerings or implement things yourself.

I also like D3D because the SDK comes with a suite of samples and tutorials, as well as complete documentation for the API. It also has PIX, which is powerful tool that you can use for debugging the rendering pipeline in your application.
Quote:From what I've found, people say OpenGL is easier to get started but DirectX is easier in the long run (I'm not sure about that).


I'm not going to get into a one-is-better-than-the-other debate, but I can say from experience that this tidbit is true. If you're just getting started, and want to simply create a window and render a fancy spinning triangle, then opengl and SDL are more friendly.

SDL will handle window management and opengl initialisation for you, and immediate mode rendering is more intuitive for beginners than working with a vertex buffer and vertex declarations or flexible vertex formats. Direct3D needs a lot of ugly win32 code to get up and running. (Actually, you can use SDL with Direct3D, but you don't see it very often).

However, once you're doing something more advanced, I've always found Direct3D to be cleaner. The reason: Direct3D's api is revised to cleanly incorporate new technologies. OpenGL however, has new features tacked onto the existing api. The result: a very bloated and complex api.

Anyone who claims that one api is faster or more powerful than the other doesn't know what they're talking about. I've had both positive and negative experiences with both.

Disclaimer: this all applies to c/c++. When using a .net language, I couldn't imagine why someone would want to use opengl over managed direct3d or xna, other than to be crossplatform.

[Edited by - gharen2 on January 5, 2008 2:07:31 AM]
If you decide to go with OpenGL, I suggest you give GLFW a try. It's a portable library to handle the window creation, input, and other OS-specific tasks that have little to do with rendering. IMO, it'll make your life a LOT easier compared to writing your own Win32 code or using GLUT, unless you really wanna go that path. GLFW's documentation is excellent, and it's also very straightforward to use. Just look at some samples.

As far as the rendering APIs go, it really doesn't matter. Both are more or less equal, and people usually pick them by preference. Only thing is OpenGL will make it possible for you to make your app run on Linux, Mac, etc. but if you don't care about that, it really doesn't matter much which you start with (first).
I've found these Open GL video tutorials:
http://www.videotutorialsrock.com/

:)

This topic is closed to new replies.

Advertisement