OpenGL vs Directx

Started by
33 comments, last by Leo_E_49 18 years, 6 months ago
Don't forget that SDL in conjunction with OpenGL will build portable source codes so you can get them to run on Mac and Linux. DirectX is stuck with just Windows (and XBox if you count that as a platform).
Advertisement
Quote:Original post by bmburditt
No Tricks book? I have read mixed reviews on the net and on this site. Not to mention he has my sense of humour. Any other book suggestions.


Best books I have ever read. You will learn from him (Andre) the fundamentals, that is skills that allow you to program a game on a system where all you have access to the screen pixels and basic "is it pressed" input. I found this to be immensely useful and highly recommend his two books (the second one especially). I am curious why so many people think otherwise on this issue.

As for the original issue? If you want to learn 2D programming then use a 2D api such as directDraw or SDL. The simpler the better here, so SDL is probably your best bet. If 3D is your goal then I recommend you start with a software 3D engine. Sure, call me crazy, but if you do this then you will gain a true understanding of how 3D processing works, and the switch to OGL or DX will be a simple matter of passing the control off to the hardware. You will know what the hardware will be doing with what you give it, and so will better know how to gain the results you want.

I can tell you now that many will disagree with me here, and making sense out of the mass of opinions can be frustrating. Follow my advice if you want to have a deep understanding of how 3D graphics work. If you do not care about that, then this advice will probably bring more grief then good and you'd be best to take the advice of another.

Hope that helps.
I don't really know why nobody ever suggests D3D. I think nobody ever says it because so many here use OpenGL or SDL so D3D is "the bad guy", but it's not. D3D and OGL are capable of the same thing. D3D is more low-level and in C++ were OGL is high-level and in C. The thing I found about OGL was that in order to get the same performance under windows as D3D, you had to use things like VBOs and extensions which pretty much eliminates the "high-level" part. Many also forget about D3DX, a set of helpful functions that eliminate the need to write somewhat complex functions(png loading in d3d is one call!). BTW those of you that can't understand D3D code need to go brush up on your GPU and C++ skills.

Anyway if you need cross-platform compatiblity than use OGL. Otherwise test both out and use the one you think is best. If you don't understand either than you need more C++.
Quote:Original post by samuraicrow
. . .DirectX is stuck with just Windows. . .


Heh, I can live with 90% of the market.
And another thing is: DirectX handles a lot of the functions that OpenGL doesn't, such as input and sound, or at least that's what I've been told. I don't know for sure because right now I'm in SDL where everything is easy. :)
The best thing to do is just choose whatever you think you'd prefer, and go for it. -Promit
My $.02:
I jumped right from C++ to D3D (and the other parts of DX) without any problems, and you get more than just graphics with DX. I found the book Beginning Game Programming by John Harbour to be extremely useful while learning DX, but it mainly tlaks about 2D; check out Programming Role Playing w/ DX 2nd Edition for a 3D look at D3D.
P.S. I'm surprised this hasn't been closed yet; normally DX vs. OGL threads kick it afer post 5...
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
Quote:
You will learn from him (Andre) the fundamentals, that is skills that allow you to program a game on a system where all you have access to the screen pixels and basic "is it pressed" input.


And what systems are those?

Game programming is hard. Worse yet, it's tedious. Writing everything from the ground up every time is foolish. Why should you read through such a large book to learn how to do things like load bitmaps that even the lowest level API [directX] does for you these days?

A waste of time and money. In my opinion of course.
Quote:Original post by bmburditt
[...]After bringing my C/C++ skills up to snuff, what do you think I should look into first[...]
Personally, I would STRONGLY suggest you buy the following three books(roughly in order, definitely buy the first before the last 2) to round out your C++ programming skills:

Code Complete, 2nd Ed.

Design Patterns: Elements of Reusable Object-Oriented Software

Modern C++ Design

They're all very good books. Reading (and understanding) them should greatly improve your coding abilities.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
I agree with Telastyn. Learning how to write a 3D renderer in software is interesting, but do you want to make games or write 3D engines? Game programming has become a big enough topic that you'll never learn everything there is to know about it, so focus on the basics and then the things that interest you. If you want to specialize in graphics or be an engine programmer, then writing a 3D software renderer may be a good idea. Otherwise, your time will be better spent elsewhere.

André's books are good for learning a wide range of foundational game programming topics, but I feel that they are kinda dated now.

Btw, Beginning OpenGL Game Programming is a great book [wink], and the follow-up is due out in a week or two.
Quote:Original post by bmburditt
...what do you think I should look into first OpenGL or Directx?

Flip a coin, it really makes no difference.

Quote:Or maybe I should be asking which book to work through first, Beginning OpenGL Game Programming or Tricks of the Windows Game Programming Gurus, 2nd Ed?

The latter is a recasting of a book written for DOS Mode 13h to roughly DirectX7 compatibility. There are better ways to learn, and better resources to learn from.

This topic is closed to new replies.

Advertisement