Confused(Opengl or DirectX)

Started by
43 comments, last by Buzz82 22 years, 3 months ago
I''ve done a significant amount of programming for both OpenGL and Direct3D, and I can''t agree with the people who say OpenGL is easier to program for. In the past (back in the DX3-days especially) that was completely 100% true, and the point couldn''t even really be argued by anyone. D3D used to be a mess that put way too much work on the shoulders of the programmer. Having to write 500 lines of code just to do a basic screen initalization is insane...

However, times change, and Direct3D has changed (a lot). Microsoft has made it a much better API, and also has created extremely useful helper APIs (like D3DX).

I supposed you could make a case that drawing simple triangles in OpenGL is easier than in D3D, but who does that anymore anyway? Everyone is using index buffers and vertex arrays, and they are no harder or easier to use in either API, just slightly different syntax.

In fact, I''d go out on a limb and say that as right now, D3D is *easier* to program for, when you view it in its entirety.

Consider this as one example: With D3D/D3DX Microsoft provides a great, efficient mesh storage format (.X) with built-in loaders that support many features including skinned mesh animation. In OpenGL you''ll need to write all of this code yourself or use some third-party library, which are generally (in my experience) rather lackluster, rather expensive and proprietary, or have license restrictions that may not be acceptable to many game developers (GPLed libraries).

Consider another example: Its currently much easier to consistently support shaders across different hardware sets in D3D. With OpenGL you''re stuck using two (or more) different methods, one for Nvidia chips, one for ATI chips, because the vendors couldn''t play nice and agree on a standard extention mechanism.

Both APIs have their pros and cons, but the only obvious advantage OpenGL has that is OBJECTIVE, not subjective, is the fact that it can run on multiple platforms.






Advertisement
In response to Outworlder...

Direct3D is obviously a Microsoft attempt to lock people into the Windows platform; I never try to deny that. Microsoft already had OpenGL running (for high-end CAD and rendering apps) under Windows NT and then Win95, and could easily have used OpenGL as the 3D portion of their overall gaming strategy. They didn't because they wanted to have an API which locked game developers to Windows (and now, to the XBOX), its as simple as that.

Microsoft isn't the only guilty party of course. 3dfx, as you mentioned, try its damnedest to lock programmers into Glide and thus 3dfx chipsets.... Microsoft was just a lot more successful due to being bigger and more powerful.

I use OpenGL for some of my projects, but I've been using D3D more and more on projects that will only ever be released for Windows anyway due to some of the benefits I see in D3D (listed above in my previous post)....At this point its really a matter of opinion...Unless you absolutely need to be multi-platform, there's no clear choice...Try both APIs and use the one you like...In fact, anyone who wants to be a 'real' game developer should make sure he/she knows both..Once you know one, if you REALLY know it, its very simple to learn the other...All of the concepts are the same....

As far as cross-platform sound, SDL is pretty good (as is OpenAL, which can work with SDL). And for networking, HawkNL does a great job of giving DirectPlay like functionality on multiple platforms, though most developers just go for the low-level berkeley sockets (winsock under Win32) which are cross-platform if you just use the basics and avoid the more complex event handling use of them that is available under some OSes).



Edited by - gmcbay on January 9, 2002 5:11:38 PM
quote:Original post by Outworlder
As for me, I'll continue to use OpenGL. I don't think there's need for Direct3D. But I have no complaints about the rest of DirectX, after all, no one has come with an acceptable hardware-independant sound API(or networking, for that matter).

OpenAL works fine for sound (also, its state machine design, much like OpenGL's, makes me feel at home ). I'm not going to comment on the rest of this thread, since everyone knows who's delusional.

[Resist Windows XP's Invasive Production Activation Technology!]

Edited by - Null and Void on January 9, 2002 5:14:33 PM
My API of preference is OpenGL, but it's really up to the programmer to decide which one they think suits their needs; they are essentially the same besides their differences in syntax (and other things, i.e. COM, state machine, etc.)

Though I would really like to see developers target multi-platform users, it hasn't really bothered me as of yet (though there are those times...).

I use Linux almost exclusively these days, and there is this excellent project called WINE (stands for "Wine is not an emulator") (There is also VMWare, haven't tried it since it costs quite a lot though). What WINE does is provide a Windows compatibility layer for UNIX based OS's (i.e. Linux). I have had success getting Starcraft and Half-Life to work on my Linux box with WINE. I am content with my setup. So, a developer doesn't have to use a cross-platform design methodology to reach Linux users, but WINE isn't perfect, so it is a great gift when the developers port their games to Linux (it just makes things easier).

They both have their pros and cons with API specific graphics capabilities, but they are equal, so it's up to YOU , the developer, to choose with which one they want to use to meet their game specific criteria

Edited by - Floppy on January 9, 2002 6:05:45 PM
Oops meant to say OpenGL can do everything Direct3D can do


||--------------------------||
Black Hole Productions
President/Programmer/Expert on stuff
||--------------------------||
||--------------------------||Black Hole Productionshttp://bhp.nydus.netResident expert on stuffmax621@barrysworld.com||--------------------------||
I really don''t think that OpenGL and DirectX graphics are identical. I can take any game and ask my friend what graphics API it is using and he can tell the difference almost 100% of the time between the two API''s. I don''t know what it is he sees, but he can tell them apart pretty easily.

I''ll even try to trick him by switching modes in Max Payne and so forth but he still gets it :/
Very true, i too can tell the difference between the two APIs.
There is a difference in graphics. Your friend is not crazy heh
There can be a difference in the way the OpenGL driver and the Direct3D driver use the video card.

The actualy API doesn''t produce anything visual, its just an interface to the hardware.
----------------------------www.physicsforums.comwww.opengl.org
OT: xgalaxy your name sounds very familiar... do I know you from somewhere???


||--------------------------||
Black Hole Productions
President/Programmer/Expert on stuff
||--------------------------||
||--------------------------||Black Hole Productionshttp://bhp.nydus.netResident expert on stuffmax621@barrysworld.com||--------------------------||
wow, don''t you love these replies.

i use Direct3D therefore it''s better.

or

i use OpenGL so it''s gotta be better.

absolutely ridiculous, but actually pretty funny.

continue guys, i think we could probably hit 200 posts and still not have an answer to unanswerable debate. wait, that''s because there is no answer. why, because both API''s can do the same stuff. or maybe because the choice is up to the programmer. or, maybe i should be coding and not wasting time trying to come up with futile reasons why one API is better than the other.

come on, can''t someone come up with something original to argue about that has no answer.

lol lol lol lol.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

This topic is closed to new replies.

Advertisement