OpenGL or DirectX?

What are the advantages and dis-advantages to using one over the other? And which one is easiest to learn for a complete newbie? Thanks!

Advantage of Opengl:

very portable(availble on a lot of platform)

direct3d, only on windows

Opengl Much more easier to learn than directX.

Disavantages, well I am not experienced enough in directx to draw other comparisons.

Hmm, I guess I’ll go with openGL then… One question though: To view openGL you need a 3d accelerator right? Do you know if it’s the same with directx?

Thats wrong. You could run a OpenGL application on a software only system with about the same image quality as on a hardware accelerator. Try this with a D3D Game :wink:

I would chose OpenGL. It is much easier to learn, far better documentated. I have started learning OpenGL about 5 months ago. Now i’m coding a outdoor engine with a really big terrain, trees, model loader code physics and a skybox. I really love gl…

Tcs

ok, sounds good. Thanks! So where should I start with the easiest tutorial possible for a total newbie?

go there
http://www.gameprog.com/reference/docs/refarticlelistuser.asp?catid=31

and read the opengl programming guide.

this is better than any tutorial as it explains all the basic of opengl.

Have fun

Try http://nehe.gamedev.net/
its a great site. I have learned much there.

Thanks everyone!

Use Direct 3D Retained Mode, it’s the easiest sollution out there.

Mike The Spike

Originally posted by Mike The Spike:
[b]Use Direct 3D Retained Mode, it’s the easiest sollution out there.

Mike The Spike[/b]

Yeah. If all you wanna do is a spinning ball without fog and alphablending and at a frame rate of 10fps on a GeForce card.

Here’s the next question…Which is faster in drawing polygons? If I had the same exact equivalent of each APIs drawing code, which will yield the higher frame rates?

To system dependant.
But then again think of this, OpenGL is not designed to run fast its designed to look good DirectX is made to run fast but not look good so why does it out perform DirectX on a properly supporting system?

Stumped?
Answer:
Microsoft.They can’t make crap work right or good.

Yes, it depends on the drivers. Both OpenGL and Direct3D is APIs for the same video hardware.

OpenGL is designed to run fast but you also have easier(?) but slower functions for the same thing. In my opinion is that a major advantage, you can write small simple program easier and faster. Direct3D on the other hand tries to forbid slow code but that can also makes it harder to do small apps that just do not care about performance. I read a post in the advanced forum from one of nvidias OpenGL driver programmers and he has the opposite opinion but I do not know why.

Another similar difference is that Direct3D tries to collect data in structures before calling the functions. DirectX is COM based and that can be annoying particular for small programs. OpenGL is more traditional. Microsoft has a OOP based framework for making the above easier but perhaps not so easy as OpenGL…(?)

Perhaps the biggest difference is how the APIs will be extended in the future. OpenGL has a mechanism that allows ATI, NVIDIA and other hardware vendors to add extensions. If the extension is being established and good will it be accepted in the core OpenGL standard after a while. This is also pretty traditional you can compare for example with the C++ standard.

DirectX has a more “exprimental” design. Every new version is really a whole new API! The latest does not have to share anything with older versions. They has promised to distribute all older versions also this is possible because of COM. The programmer must say which API like D3D 3,4 and so on that he wants to use. Everything is standard from the beginning but can be gone in the next release. Microsoft has 100% control and does not allow any hw extensions.

Play around with both but forget about Direct3D retained mode since it was dropped several years ago and is not updated any more.

OpenGL is designed to run fast but you also have easier(?) but slower functions for the same thing.

my point was GL’s first priority is that it looks good speed was secondary while with DX its just the reverse.

OpenGL is much much better in every way, performance, ease of use, documentation, looks, and everything else. Just look at a game like UT, then run it in OGL and then in D3D, you decide.

i’ld be surprised if unreal ran faster with opengl than d3d. have you run benchmarks?

maybe i’m wrong, but do DirectX use the opengl.dll/opengl32.dll for drawing ?

DirectX using OpenGL for drawing?!.. That would be the biggest api scam to date!

No, DirectX (ddraw d3d) dont use OpenGL. Atleast not that I know of.

Pherhaps there are wrappers, functions on top of opengl that looks like d3d. But thats another story.

Originally posted by bla:
my point was GL’s first priority is that it looks good speed was secondary while with DX its just the reverse.

Perhaps but if you mean that something that could increase performance was sacrificed can I not agree. Take immediate mode and vertex arrays. Both are supported and the programmer can select between them.

I guess we have the same opinions about DX but I think they failed. You have to do some “artifical” programming but the reward in speed increase seems to be zero.

OpenGL and DirectX both have their advantages… I think OpenGL is easier to start with in the beginning. But if you’re having a lot trouble with maths, it will get a lot harder, because you have to do alot by yourself…

OpenGL doesn’t take care of sound, music and input events (keyboard, mouse, joystick). So you’ll need to implement that yourself or us an existing library/API that takes care of that… www.openscenegraph.org is one of them.
OpenGL was created primarily for computer graphics.

DirectX takes care of all multimedia devices… Enumerating a joystick is not too hard, the same thing with playing sounds.
x

In the end it isn’t easy to say which one is better… ppl saying one is crap are being as mindless as with the whole Windows/Linux discussion. I think it’s better to try both a bit…

But OpenGL is better to start with…
Good luck
OpP