OpenGL and Direct3D

Started by
18 comments, last by ColonelMustard 23 years, 11 months ago
I completely agree with ga and davior, OpenGL is a much cleaner and well designed API than D3D. The only advantage that I can see in D3D is its integration with DDraw, but that''s all (we could have that with OpenGL, IF Micro$oft supported that, but no! They want to create an 3D API themselves...). I think OpenGL is the best choice.

Nicodemus.
Nicodemus.----"When everything goes well, something will go wrong." - Murphy
Advertisement
I actually decided to go OpenGL because being a newbie, it was too hard 4 me to figure out why MSVC++6 said "Error : No overloaded function D3DVECTOR/D3DVERTEX takes X parameters". I couldn''t figure out why, and all my tutorials setted vertices up like this:
pVertex[n] = D3DVERTEX(D3DVECTOR(...,...,...)......)
Now if somebody could help me get rid of this annoying bug, I would be most grateful (It''s probably very simple
Thanks for the feedback

Mustard
Hello,
I made the same experience like JonHobson. I learned OpenGL and wrote my first small game and I sent it as an email to all my friends. The result: 1 of 12 had an 'playable' openGL supporting card. This is more than a year ago. Now everyone, yes everyone has a OpenGL compatible card at the speed level of the Riva TNT cards.

So the times were one could complain about bad OpenGL hardware acceeration are over. I recently heard that there are XServers for Nvidia chips. So we now have hardware acceleration in Linux.

Edited by - TheMummy on 5/6/00 12:13:35 PM
This is in reply to ColonelMustard''s problem. The D3DVERTEX does not use D3DVECTOR''s. It uses 3 D3DVALUE''s for it''s position. So replace D3DVECTOR(...,...,...), with ..., ..., ...
I think that should do it.

*** Triality ***
*** Triality ***
Man, these D3D/OpenGL threads just never die!!!

They''re both good API''s each with notable flaws but also great pluses. Take your pick!

Sieggy
zerwit: that's exactly us openglers point: D3DVALUES!!! why not just use ints/floats. It's a small thing but it's the principle of it.

I also used some D3DRM(the "easy" version of D3D.) After writing a whole shitload of code just to make a colourless primative, I figured my whole idea of becoming a professional game developer was over. Then I read a Nehe tutorial on Opengl. Halleluha! may the lord praise opengl

Edited by - Chrono999 on 5/7/00 5:27:27 PM
Hey chrono, a D3DVALUE is just a float. To assign a value to a D3DVALUE you just do
vertex.x = 10.0f;
And this allows direct3d to change data types and not have to change each place where they entered int or float. It''s good programming practice, and it I prefer it.

*** Triality ***
*** Triality ***
I have been using D3D for a while now, and I was able to get up and running by reading through a few pages of the Docs. I have found that D3D is easy to use and have never had any problems with it. My experience with OpenGL is not as large as with D3D, but I have found that it is roughly the same. The reason I prefer D3D is because I have found it easier to find resources for it, its got very large support, and the code matches that of the other DirectX APIs. If you dont like D3D or OpenGL, then dont use it. Program whatever you need to to get the job done, because in the end you can do anything in D3D or OpenGL that you can do in the other. If one API has an advantage somewhere, so be it. That same API likely is lacking somewhere else. Noone will ever deliver a "perfect" API because one person''s ideas will never be the same as anothers. So I say, to each his own, and do what you like, but dont be swayed by opinion, because that is what leads the shoddy games on the market. Do whatever you like.

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

Though nobody gives a shit, I''m going to post my opinion here. I do consider myself at the very least an advanced user of both Direct3D and OpenGL. I''ve used multiple versions of GL, as well as D3D/DX, and here are my thoughts.

First, I''m going to say that I''m a Direct3D person. Why? I can''t tell you why, since I don''t even know. I''ve spent far more time with OpenGL, but yet I remain a D3D person. Don''t ask me to explain it - I''m already doing my best here to. That being said...

I like OpenGL. It''s warm, fuzzy, and does my laundry for me. That''s the problem. I don''t really feel like I''m running OpenGL, but more like it''s running me and telling me to like it. Everything is just kinda there, but hidden from my reach. I don''t really like this, probably because I think that programming should give the programmer control over what''s going on, and it just doesn''t feel right when I''m writing GL code. I have no idea how much stuff is being hidden from me behind the scenes, but I''m sure it''s huge and I don''t like that. So now I''m going to bring up D3D.

There are two incarnations of D3D that I haven''t forsaken. D3DIM and D3DX. I like both. Both are my style. Personally, I''ll take D3DIM simply because it''s closer to my style of coding (I grew up with DirectX), but I''ll also be happy to use D3DX. First off, you''ll get confused at first with the IM, but that''ll pass and you''ll love life. D3DX is for people who like ease of setup and additional utility functions. Either is better than GL in my mind, simply because it''s more to my style. As I prefaced this all with, I have spent a hell of a lot of time with all three - most of all OpenGL - yet I''m an extreme advocate for D3D. It just feels right.

So that brings me to the disclaimer. I don''t want you to make a decision based of any of mine. Don''t even pay attention to what I''ve said here. You should have stopped reading at the second paragraph. Just know that this is nothing to do with discrimination against OpenGL or D3D. It has nothing to do with which I prefer. I could give a rat''s ass about platform independency. I''ll write a game for a single platform, and basically say screw it to everyone else. I do make most of my stuff in NT though, so I use GL to avoid that beast that is D3D 5.0. Anyway, just please try both. Make a game (preferably the same style, or even two versions) that uses each one. Only then will you be able to make any form of educated decision on which to use. You''ll find that most people who say that one is better than the other are only verifying their own previous decision. If someone were to tell me that they know both, I would question them. I would demand to see what they''ve done in each. Then I would know that they made their own decision based on their knowledge, rather than what they''ve heard. NOTE: Many people will claim to have done both, but actually lie. Usually it''s just something to make themselves sound better. Please, if someone claims to have done both ask to see what they''ve done. They''ll squirm. It''s funny. Anyway, I''m gonna get going now. Good luck in your quest.

Pythius
"The object of war is not to die for your country, but to make the other bastard die for his"
>>Now I heard that OpenGL was both simpler and more efficient than Direct3D

It is not more efficient. In general, D3D drivers are better optimized and run faster.

>>Can anyone smell a flame war coming up?

Yep.

>>...once I saw HALO in GL I said who cares about D3D

The API has nothing to do with your end results. When it comes down to it, they are doing the same thing.

>>and the upcoming promising OpenML.

I wouldn''t worry about OML for a while. Right now it''s vaporware -- it doesn''t even exist yet.

>>IMO it seems as though openGL will end up being the more common of the two

Before Direct3D, there weren''t really that many 3D games, and accelerators were rare. But when we started seeing accelerators, Direct3D quickly surpassed OpenGL in development-base because it''s drivers were generally better, it is updated frequently to take advantage of new hardware features, etc. Right now, D3D games hugely outnumber OGL ones...although many major titles support both.

>>What''s with software mode? which is faster/better?

Neither D3D nor OpenGL software modes are fast enough to do anything at an acceptable speed. You''d be better off writing your own...but these days, hardware-only is an acceptable thing.

>>I think OpenGL is much better structured than Direct3D.

I don''t see anything wrong with D3D. It was written by very intelligent engineers, and it shows. It''s pretty easy to use if you actually know C/C++ to begin with.

>>OpenGL is in version 1.2 and DirectX in version 7.

This isn''t directly comparable. OpenGL is almost never updated, because the ARB is a group of slow, grumpy old men (hey, that''s what Sweeney said =P). The ARB takes little interest in games, although that is the largest userbase of OpenGL applications.

DirectX is updated quickly, usually every year, hence the higher number. The reason it is updated is to incorporate new ideas and innovations, as well as user feature requests, which the ARB all but ignores.

>>OpenGL does not often need to be changed to support newest 3D card features.

OpenGL proper hardly ever changes, but there are a gazillion OpenGL extensions out there by each hardware vendor. If you consider those as OpenGL proper, than it changes just as much as D3D.

>>OpenGL is a much cleaner and well designed API than D3D...

Learn to program in the first place, and there will be no problem with D3D. =P

>>said "Error : No overloaded function D3DVECTOR/D3DVERTEX takes X parameters".

You are providing the function/macro with either too few or too many parameters.

>>I couldn''t figure out why, and all my tutorials setted vertices up like this...

You have an array of vertices. D3DVERTEX is a macro to define a vertex. You wouldn''t use a vector as a parameter in that case, but conceptually, a vector is generally the same as a vertex, but is directed.

>>So the times were one could complain about bad OpenGL hardware acceeration are over.

D3D drivers are usually better optimized and push higher framerates.

>>zerwit: that''s exactly us openglers point: D3DVALUES!!! why not just use ints/floats.

Its the same as using GLfloats in OpenGL. You are using them aren''t you? Since data types are hardware dependant, using your API for types is a great way to not worry about alterations of the API or hardware environment.

>>Program whatever you need to to get the job done, because in the end you can do anything in D3D or OpenGL that you can do in the other.

Yep. When the day is done, the end result is generally the same (but as I''ve said, D3D drivers are usually better).

>>I don''t really feel like I''m running OpenGL, but more like it''s running me and telling me to like it.

Uh... OpenGL is an immediate mode API. There''s next to nothing it forces upon you.

>>I could give a rat''s ass about platform independency...

Heh, right now, nor do I. But it''s good practice to develop things in a platform independant manner, as we don''t know what will happen in the next few years.

--------

I''ll say that OpenGL is indeed easier to get into, especially for beginners to programming in general.

Eventually, once you get familiar with programming and graphics theory, you will want to create a generalized graphics abstraction where you can simply switch between APIs and/or software as needed (like Unreal or Homeworld).

One thing is, with Direct3D it''s much easier to determine the capabilities of the hardware you''re running under, where in OpenGL, you really have no functionality for this (in such cases, you''ll have to document all or most of a potential hardwares features and shortcomings beforehand, and then check the vendor id).

As well, Direct3D''s texture management is a great thing in comparison to using GL texture objects. Feature for feature, D3D does outclass OGL by a considerable margin. I can say that DX8 is going kick some serious ass as well.

In any case, both are perfectly viable options; you can get the same results when the day is over.

=============
Brian Smith
MIS DBA / Applications Developer
Creativity is a bloody nuisance and an evil curse that will see to it that you die from stress and alcohol abuse at a very early age, that you piss off all your friends, break appointments, show up late, and have this strange bohemian urge (you know that decadent laid-back pimp-style way of life). The truly creative people I know all live lousy lives, never have time to see you, don't take care of themselves properly, have weird tastes in women and behave badly. They don't wash and they eat disgusting stuff, they are mentally unstable and are absolutely brilliant. (k10k)

This topic is closed to new replies.

Advertisement