Thread: OpenGL vs DirectX

  1. #1
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104

    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,
    1.OpenGL
    2.DirectX
    (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?

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    361
    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).

  3. #3
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104
    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!
    And as far as i know, OpenGL workz for Linux too...and thats atleast not a drawback

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Do a search on the boards. This question has been discussed a number of times.

  5. #5
    eat my shorts!
    Join Date
    Apr 2002
    Posts
    294

    Arrow

    21 results with keywords in title: "directx vs opengl"
    http://cboard.cprogramming.com/searc...searchid=80976

    Games Reviews Previews Desktop Themes Downloads Paintball Forums Shareware Freeware and much more

    The best in Technology and Gaming News

    www.back2games.com

  6. #6
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    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.



    Epo,

    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.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    ::Add's a dollar to my account::

    Too many discussions about this.

  8. #8
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331

  9. #9
    Registered User
    Join Date
    May 2003
    Posts
    195
    Are more games made in DirectX nowadays than in OpenGL?

  10. #10
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    I searched google and found nothing conclusive. I'd have to bet their about even since most games offer the use of both anymore.

  11. #11
    Registered User
    Join Date
    Sep 2004
    Posts
    197
    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 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.

  12. #12
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    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.

    EDIT:
    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.
    See you in 13

  13. #13
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    It is still called DirectX which actually makes reference to the entire API including the sound, multimedia, and input portions.

  14. #14
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    Name of the title is "OpenGL vs DirectX" and OpenGL is specifically rendering, the Direct3D counterpart.
    See you in 13

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

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