Thread: Which is best DirectX or OpenGL

  1. #1
    Registered User jr2007's Avatar
    Join Date
    Oct 2003
    Posts
    16

    Which is best DirectX or OpenGL

    I am getting confused with DirectX and OpenGL and the rest. Which is best to start with?
    JR Industries
    www.neono.co.nr

  2. #2
    Still A Registered User DISGUISED's Avatar
    Join Date
    Aug 2001
    Posts
    499
    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

  3. #3
    Registered User
    Join Date
    Jan 2004
    Posts
    26
    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.

  4. #4
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    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.

  5. #5
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    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.
    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.

    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 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.

    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.

  6. #6
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    DirectX is more than just graphics. That includes sounds, user input (mouse and keyboard) and networking.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  7. #7
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    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.

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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 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.

    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.
    Last edited by VirtualAce; 01-14-2004 at 04:57 PM.

  9. #9
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    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?

  10. #10
    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).

  11. #11
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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.

  12. #12
    Registered User jr2007's Avatar
    Join Date
    Oct 2003
    Posts
    16

    Talking Thanks

    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.
    JR Industries
    www.neono.co.nr

  13. #13
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    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
    identical to how it is done with opengl, except instead of microsoft they have the architecture review board

  14. #14
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    ...they have the architecture review board
    which of course squabbles and never gets anything really done(took them forever to get a shader extension agreed upon, too many company rivalries).

    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.

  15. #15
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I also dont know why everyone views it as so hard, when in many ways, its interface is more self-explanatory than OGL.
    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.

    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.
    Last edited by VirtualAce; 01-17-2004 at 01:15 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Going from DirectX to OpenGL
    By Wraithan in forum Game Programming
    Replies: 19
    Last Post: 02-24-2006, 11:07 AM
  2. Allegro, OpenGL.. or even DirectX?
    By Zeusbwr in forum C++ Programming
    Replies: 1
    Last Post: 11-14-2004, 08:16 AM
  3. Which is better: OpenGL or DirectX
    By Stan100 in forum Game Programming
    Replies: 2
    Last Post: 05-09-2003, 04:43 PM
  4. OpenGL 2 or DirectX ?
    By alex6852 in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 01-02-2003, 02:31 PM
  5. So.. what's the difference between DirectX and OpenGL?
    By QuestionC in forum Game Programming
    Replies: 6
    Last Post: 01-19-2002, 06:18 PM