Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Rob Loach

OpenGL VS DirectX

This topic is 5799 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Which do you guys prefer? I''ve been learning DirectX and wondering about OpenGL. How it differs, if it''s better (or worse), etc. - Rob Loach OverTech Technologies __________________________ "Life moves pretty fast. If you don''t stop and look around once in awhile, you could miss it." - Ferris Bueller

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
It doesn''t matter really.
DX today as well as the upcoming version has a syntax that is very easy to use. OpenGL is also very easy to use and learn. Dx has the benefit of the widest hardware vendor support even though there are pretty much only two contenders today: ATI and nVidia. Both which support OpenGL actively. On nVidia boards OpenGL is built into the hardware I can''t say how it is on ATI boards. It might be different on ATI boards. Performance differs very little and is more subject to driver quality rather than anything else. I would say that OpenGL vs DirectX is not a contest any more. It is more a personal subject about syntax preference. Personally I like OpenGL, I started out with OpenGL since I found it easy to learn but nowadays I use DX exclusively. Most because the majority of the industry is using DX. So it is a matter of choice really. Take a good look on both of the API''s and don''t just skim through. Try them out and then decide which you want to use.

Share this post


Link to post
Share on other sites
Learn them both

I started 3 years ago with OpenGL and I recently started to learn DirectX. I like them both and when OpenGL 2.0 is out the differences between them will become smaller.

As the AP said, it''s a matter of personal opinion. On nexe''s site he asks the following:

glDrawElements( GL_TRIANGLES, ..., ..., ...);

or

pDevice->SetVertexShader(...);
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, ..., ..., ...);

Choose the one you like

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Performance differs very little and is more subject to driver quality rather than anything else.


this assumes that programmer writes optimal code, which is obviously not true for most programmers out there.

it would be interesting to compare framerates of typical games developed by d3d and gl programmers of similar experience, don''t you think?

Share this post


Link to post
Share on other sites
quote:
Original post by Scheermesje
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, ..., ..., ...);


ugh. never use up calls, vertex buffers for everything.

edit: and your example is completely unrepresentative and shouldn't be used for anything. differences between apis are more complex than that code.

for me, it comes down to extensions. gl is easier to get started with, in part due to the convenient glvertex and gltexcoord functions that any performance-aware programmer would avoid like plague, but it becomes a huge pain once you start using extensions and end up having three code paths for a lot of code:

- nv extension code
- ati extension code
- fallback in case neither is present

dx is harder to set up, which supposedly is the biggest reason why people dislike it, but the gap between writing simple code and writing efficient code is much smaller than said gap for gl.

want an example? vertex buffers and usage flags vs var/vao extensions. also drawprimitive vs glvertex.

woah! i looked at the article again, and it sure enough doesn't address the above issue. not only that,
quote:
article
Although useful for testing a graphics card's abilities, vendor-specific extensions are not frequently used by commercial applications.


i find this impossible to believe.

[edited by - niyaw on December 7, 2002 8:00:05 AM]

Share this post


Link to post
Share on other sites

I have to agree with the above. Starting up with OpenGL is easy because of immediate mode. However, until GL 2 is widely available, I won''t be continuing with GL (I''m using DX now). DX these days is very easy to setup and get working with (at least as easy as OpenGL). I like the DX vertex buffers much better than (as above) having to use VAO, VAR, etc. Also, believe it or not, utilities for .x file objects also make it easy to integrate more advanced functionality initially into the engine. Otherwise, I have to search out libraries etc. for loading meshes or write my own with OpenGL.



Share this post


Link to post
Share on other sites

This topic is 5799 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!