[DirectX, OpenGL] Beginner OpenGL vs DirectX

Discussion in 'Mixed Languages' started by CHEF-KOCH, Nov 17, 2013.

Tags:
  1. CHEF-KOCH

    CHEF-KOCH MDL Expert

    Jan 7, 2008
    1,192
    1,185
    60
    #1 CHEF-KOCH, Nov 17, 2013
    Last edited: Dec 1, 2013
    Hey guys, this is another topic requested by some users. It maybe helps you to start your coding and to choose the "right" language.

    So what's recommend if you are brand new and have no hardware limitation? (because older hardware can't handle "new" apis).
    It depends on your choice of flavor really.

    Here are my wishes for this thread:
    • Please no off-topic stay on topic, always.
    • No "xyz is bull*** use zgs" posts.
    • No AMD vs. Intel/nVidia or other discuss like this please won't help anybody.
    • Please link to the source if you talking about xy, this helps people to understand.
    • Be friendly as always.
    • You see my statement different, no problem, stay friendly and give us some details.
    • Please use thanks-button instead of post it.
    • No illegal stuff, don't know why I must wrote this but there is always one troll in every thread posting such stuff .. sad but true.
    • Read the links very carefully until you ask unessasary questions.
    • Have fun!

    Here's a few pros & cons:

    OpenGL DirectX
    Basic OpenGL (ie. just drawing colorful triangles) can be super-simple, but it leads you into a trap once you want to start with interesting stuff. DirectX can be a bit fiddly at the start but once you got the hang of it it's pretty much the same all the way down
    OpenGL documentation is rather sketchy, DirectX is considerably more professional. DirectX debugging facilities used to be inarguable better, unsure how they are now: OpenGL has gDebugger now for free but it was still kinda sketchy I last checked, DirectX PIX got integrated into Visual Studio so that might've gone down the drain since. For DX9 at least, there was no contest between the two.
    The API design is debatable: OpenGL is rather "loose" (no enums, dynamic extension loading, no return values, etc.) whereas DirectX is stricter. DirectX also has debug runtime + reference rasterizer, which helps a lot when it comes to compatibility testing.
    OpenGL is multiplatform, DirectX limits you to Windows. DirectX has a stricter hardware-abstraction layer, which means you get a better chance of your stuff working and looking the same on any computer config. With OpenGL a lot of that is at the mercy of the drivers: ATI shader compilers stick stricter to the standard so some shaders that work on NVIDIA (whose compilers are more lenient) might just break on ATI during compilation.
    OpenGL shader compiler is a lot faster than DirectX when it comes to loops or branching.
    OpenGL basically hands you WebGL for free. Microsoft has made a pretty unpleasant DLL hell with D3DX (in DX9 at least), so if you use that, you might want to ask people to install the full runtime or supply the DLL yourself.
    Raymarching pixel shaders in D3D9 are 3 times slower than the same in model4 with D3D10. OpenGL follows the evolution of upgrades. Moreover, compilation of shaders in pure D3D9 is 10 times slower than compiling with D3D10. So you are obliged to supply modified DLLs with your program.
    Market share. The market share of Windows on the desktop is bigger than that of OS X which in turn is bigger than that of Linux. Money talks.
    .. there are many more, but I think this is enouth.


    Conclusion:
    There is no best API for Beginners!

    So I suppose it all depends on your mileage and what you expect from an API. There's plenty of source code going around for both so I'd recommend just taking a look at both and deciding which flavor you prefer.


    Sources:
     
  2. jacobsmith

    jacobsmith MDL Novice

    Nov 14, 2013
    1
    0
    0
    Hi,
    I read your post. I think your post very well for every people and I have a small website. Through which you can learn English online. If you like it, please go to this site around once
    Thank