I am getting confused with DirectX and OpenGL and the rest. Which is best to start with?
Printable View
I am getting confused with DirectX and OpenGL and the rest. Which is best to start with?
Try using the search feature as this discussion has been brought up many times and your likely to find your answer there.
Also, try searching for articles over at www.gamedev.net , they have beaten this topic to death with a stick and you'll find a lot of good information.
IMO, OpenGL is more newb friendly, but what do I know .. i'm the one software developer on Earth that didn't get into the business to make video games ;)
I'd highly suggest OpenGL for one simple reason - You can easily port your OpenGL programs to other operating systems. Can't do that with DirectX. Well, not without a ton of porting and fustration.
OpenGL is easier, and I have yet to see an OpenGL based renderer beat by an equivalent Directx based renderer. They're both ultimately good, but I highly suggest OpenGL. I've been programming with it for, oh I dunno, must be like two years or so.
null and void, with only 8% of the consumer market being non-windows, there really is no reason to focus on opengl over directX unless you are making a professional app that needs to be on multiple platforms.Quote:
I'd highly suggest OpenGL for one simple reason - You can easily port your OpenGL programs to other operating systems. Can't do that with DirectX. Well, not without a ton of porting and fustration.
I am highly suggesting DirectX right now, as the little touches are nice, such as, not having to worry about writing up your own matrix math libraries(you still have to know whats for what, but you dont have to go through that hassle of getting a full Matrix library), as D3DX comes with alot of extensions for those purposes. I like opengl alot, but the problem is, while it is simple, once you get beyond the simplicity, your at the end of the standard OGL library and will have to create everything by hand.Quote:
OpenGL is easier, and I have yet to see an OpenGL based renderer beat by an equivalent Directx based renderer. They're both ultimately good, but I highly suggest OpenGL.
so, either way you go you are ok, but I would officially recommend both as you will need both if you are planning on getting a job in the gaming industry.
DirectX is more than just graphics. That includes sounds, user input (mouse and keyboard) and networking.
yeah, I forgot to mention that, that unless you are going to use OpenAL, most companies will have you use DirectX anyway for atleast sound/input/etc. even if you dont use D3D.Quote:
DirectX is more than just graphics. That includes sounds, user input (mouse and keyboard) and networking.
I disagree. Most companies that I've been looking into have two dev teams or simply program with one API or the other, not both. Check out some recruiting websites and company websites and you will find out that most companies, if not all, are gradually moving towards DirectX. The XBOX craze has only strengthened that movement since it, too, uses DirectX.Quote:
so, either way you go you are ok, but I would officially recommend both as you will need both if you are planning on getting a job in the gaming industry.
I'm sorry but the age of third party graphics API's is simply nearing an end. Very very few of any of my current games, in my library of nearly 270, natively support OpenGL. True that most FPS shooters - or at least the big hitters like DOOM 3, Half-Life 2, Unreal 2, etc. do natively support OpenGL but most commercial games stay with DirectX.
DirectX is really quite a brilliant API if you DON'T learn it from the supplied documents. MS really needs to work on their documentation for both MSVC and DirectX. The help files are so confusing they read like stereo instructions.
And, as has been mentioned, DirectX is a complete API. It supports extremely fast access to music hardware, input hardware - all sorts as long as the vendor has a driver for it, graphics hardware, etc. It has native support for playing music files - MIDI's at least, and has enough robustness to it that one could easily program their own streaming music library for just about any type of file format. DirectX is very awesome because it's all there - everything you need to make a very good game with high production value quality is there. It's up to you to use those effectively. Two thumbs up here....way up.
why are you guys talking about the other components of directx? when you get a thread comparing OpenGL and 'directx' isn't it kind of implied that you're only talking about rendering, i.e direct3d and directdraw only? You can still use all of the other stuff in the directx library if you use OpenGL...hell even carmack does that in his engines.
and bubba maybe you can answer me this question, but exactly WHO in the hell implements direct3d and direct draw? is it all the same implementation that just accesses whatever video hardware that is available?
May I jsut add that compared to OpenGL, DirectX is just a pain to use (especially if yo ucompare it to the ease of using glut).
It is my understanding that Microsoft decides on the function prototypes, if you will, and then the vendors for each video card supply the actual code bodies for the functions. This allows a universal interface to the API, but the code base changes to suit the video hardware - thus the video card vendors write the driver.
COM is all about function pointers so it is very simple to create the interface. MS does create software functions to emulate those functions not supported in hardware, but they are very slow.
DirectX consists of the
HAL - hardware abstraction layer
HEL - hardware emulation layer
For more info www.msdn.com - search on DirectX or d/l the dx9 sdk.
Thanks for all this. I have decided to start with OpenGL as many have suggested it to be easier but i think that in order for me to really get into game programming i should learn DirectX stuff.
identical to how it is done with opengl, except instead of microsoft they have the architecture review boardQuote:
It is my understanding that Microsoft decides on the function prototypes, if you will, and then the vendors for each video card supply the actual code bodies for the functions
which of course squabbles and never gets anything really done(took them forever to get a shader extension agreed upon, too many company rivalries).Quote:
...they have the architecture review board
I think that if you are going into the industry, learning DirectX (the full API) is the best bet, as you will probably have to use everything else besides D3D if you make an openGL game. I also dont know why everyone views it as so hard, when in many ways, its interface is more self-explanatory than OGL.
... I am just going to shutup now as I love both and dont want to turn this into a flame war.
If you can understand that a toolbox has many drawers with many different tools in them, then you can understand DirectX and COM. But with COM each tool box drawer could also have a smaller toolbox in it with drawers, boxes, etc. and so on.Quote:
I also dont know why everyone views it as so hard, when in many ways, its interface is more self-explanatory than OGL.
COM is easy and so is DirectX. In fact, DirectX is bordering on simple if you buy a book that explains how to set it up. Once that is done, the rest is very straightforward.
Having programmed a small 3D engine in DOS and a sound engine, DirectX is a lifesaver. Programming my sound engine in DOS was not easy and relied heavily on one sound card rather than supporting all of them. With DirectX as long as the vendor writes the function bodies for the functions - thus the drivers/dlls - it is supported under DirectX. Ingenious. Kudos to MS for DirectX.
For sound engines you don't have to worry about DMA modes, programming, or DMA page registers. You don't have to worry about writing an interrupt handler to handle the sound card interrupt and you don't have to write an additive mixer because its all done for you. You simply load the sound, specify if its looping or not, and then play it. DirectSound will auto-mix your sound into the primary buffer and thats it. But you can also mess with the primary buffer if you need to - it uses a circular buffer just like the old DOS sound API's. The DMA activity and programming is transparent to you which is, trust me, very nice.
With DirectInput you can gain access to nearly every modern device out there provided there is a driver for it. Keyboard programming is a snap with DirectX - no more interrupt 09h handlers, no more headaches with extended key codes or multiple key combinations. No more 'stuck key' issues if NumLock is on or off. As well the gamepad interfaces are so simple and the mouse, albeit a bit more complex than DOS, is still easy to use.
I don't know anything about OpenGL and I'm not against it or anything, but don't shy away from DirectX because someone told you it was too hard. It's not.