OpenGL vs DirectX
Hi everyone :)
I have now read a C/C++ book, and i now master object-oriented programming, classes, structs, operators, functions, pointers and such.
I have also read trough "Carles Petzold programming windows", so I also know the basics+a little advanced stuff on the Windows API.
What I want now to take a step forward, and start make something funny, a game for instance.
As far as i know, i got two possibillities,
(There are surely some more, but this is the two best and most known languages in game programming, isnt it?)
-What are the differences between them?
-I want to devlop games for the windows platform, and im using Visual Studio 6.0, who of them should i pick?
Never used OpenGL (for more than an hour) but from what I understand...OpenGL and DirectX are kind of like VB and C++.
OpenGL is pretty bulky, making it a tad slower, but, you can accomplish the same task with fewer lines and less complicated code. DirectX on the other hand is much more flexible with what you can do, but because of this, requires more time initializing to get it the way you want, and more lines of code to accomplish a task. DirectX is faster with more capabilities, but OpenGL will also get the job done, probably with fewer lines of code (depending on what you're trying to accomplish).
I don't know much about OpenGL, I've always stuck to DirectX, it is one of the best (if not the best) graphical engine libraries out there. I'd recommend DirectX. There are many great tutorials out there that will guide you if you do a search on Google (DrunkenHyena and Andy Pike come to mind first).
I've taken a look at some DirectX and OpenGL tutorials.
What I think seems clumsy with DirectX is the DirectSound/DirectInput and all that stuff...
If both languages can make the same, and both are about equal in how fast I can learn it, I think i go for Open GL.
OPEN(source) GL, freeeeeee! :D
And as far as i know, OpenGL workz for Linux too...and thats atleast not a drawback ;)
Do a search on the boards. This question has been discussed a number of times.
21 results with keywords in title: "directx vs opengl"
how to deside depends on your requirements, read up on both, pick whichever will work best for you.
both have selling points for making games.
first OpenGL is not bulky... it takes less lines because of how the API was designed... Direct-3D takes more for the same reason.
second, the speed difference at the moment is negligable because it depends on your video card vendor, but technically OpenGL has the potential to be faster because of its design, lack of bulk in some areas, and its open standard which allows for more optimization by the vendor... look at ATI's Hyper-Z for an example, now even more so since Direct-X 8 which if im not mistake came with acknowledged performance drops i think i read as much as 15% in some areas( mostly non critical areas, so look it up before you make a judgement, and do it incase im mistaken, which happens... a lot)... but even so they both preform similarly... it all depends on the card and drivers.
thrid, at the current time OpenGL has many more capabilities than Direct-3D, but i think Direct-3D has a one or three OpenGL doesnt here and there... OpenGL is used in pretty much every high end 3D app for this reason(i.e. its advanced graphics capabilities and platform independance), but a lot of OpenGL's other capabilities you will almost never use in games.
Direct-3D's(and i dont mean Direct-X's other components) big sell is its multitude of helper llibraries that handle many "complicated" tasks for you.
OPEN(source) GL, freeeeeee!
OpenGL means Open(Standard) Graphics Library
it is NOT open source, though SGI released the source to a sample software implementation. OpenGL is however non proprietary and free to use.
>And as far as i know, OpenGL workz for Linux too...and thats atleast not a drawback
its OS independant. meaning it works on anything(that has the libraries anyway)...
Also most people miss a major point in the design goals of both API's
Direct-X is made for games, its original design was for making games, thats what its tuned for. it as a whole is supposed to be EVERYTHING you need to make a game, and it seems like it is.
OpenGL is designed for high quality high preformance 3D graphics, a lot of things for high end applications, but also for general purpose graphics (lot of "high" in there eh?).
but it is just as suitable for games. also a major design goal was to be as minimal as possible, and give you the most basic tool's to build from, giving you the absolute MOST flexibility you can get. at the cost of doing everything yourself.
nobody can really tell you which your going to like or need for your app's i like OpenGL because its like C small, powerful, non-bulky and it stay's out of your way, its felixibile because it lets me do everything myself, and expects i know what the hell im doing, the cost is you are provided with the minimal amout of tool's and you have to do most of the work yourself, which i like...
Note: please forgive any omissions, seeming bias(i tried to give a non-biased comparision i think i more sold Direct-X myself...), or blatant errors... im really tired at the moment.
::Add's a dollar to my account::
Too many discussions about this.
Are more games made in DirectX nowadays than in OpenGL?
I searched google and found nothing conclusive. I'd have to bet their about even since most games offer the use of both anymore.
There is more use then just games for 3D rendering.
You will find though that most profesional CAD programs are writen in OpenGL, since its much better suited, from my understanding. Direct3D is fine for games, and OpenGL can some times be over kill. Then again, OpenGL great for crossplatform :D Personally, if I have the chance to work on a 3D rendering system, I would try OpenGL, but thats me, its all about what you need/want your program to do.
Hands down more games are used with DirectX.
OpenGL was actually meant more for CAD and engineering design and first geared towards an SGI operating system called Irix. They both compete quite well for high speed realtime performance graphics for games, because under the hood they are essentially the same thing.
And, although I'm in the habit of doing so, it's not really correct to say 'DirectX'. What we are really talking about is the Microsoft portion of the DirectX standards that takes care of 3D primitive rendering, aka Direct3D.
It is still called DirectX which actually makes reference to the entire API including the sound, multimedia, and input portions.
Name of the title is "OpenGL vs DirectX" and OpenGL is specifically rendering, the Direct3D counterpart.
Which is why discussions like this are assinine. DirectX is a whole lot more than just a fancy 3D renderer. If you miss that then you are missing out on the beauty, simplicity, and design goals of DirectX.