DirectX or OpenGL?

  • (2 Pages)
  • +
  • 1
  • 2

28 Replies - 3648 Views - Last Post: 09 April 2010 - 11:29 AM Rate Topic: -----

#1 Trav  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 210
  • Joined: 01-March 10

DirectX or OpenGL?

Posted 06 March 2010 - 12:03 PM

Wouldn't' mind some Pros & Cons on both these. I'm probably leaning towards OpenGL, for one nice tutorials here at Video Tutorials Rock. But if there are advantages of DirectX over OpenGL, I'd like to hear them.
Is This A Good Question/Topic? 0
  • +

Replies To: DirectX or OpenGL?

#2 besten  Icon User is offline

  • New D.I.C Head

Reputation: 12
  • View blog
  • Posts: 40
  • Joined: 03-March 10

Re: DirectX or OpenGL?

Posted 06 March 2010 - 12:09 PM

Well, OpenGL doesn't support sound, networking, input devices (mouse,Joysticks).
OpenGL is equivalent to the Direct3D, which is a part of DirectX.
Was This Post Helpful? 2
  • +
  • -

#3 taylorc8  Icon User is offline

  • B&

Reputation: 149
  • View blog
  • Posts: 1,572
  • Joined: 21-July 09

Re: DirectX or OpenGL?

Posted 07 March 2010 - 04:30 AM

Here's a free (mostly) audio library if you need it: http://www.ambiera.com/irrklang/
Was This Post Helpful? 0
  • +
  • -

#4 PlasticineGuy  Icon User is offline

  • mov dword[esp+eax],0
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,436
  • Joined: 03-January 10

Re: DirectX or OpenGL?

Posted 07 March 2010 - 04:32 AM

I would go with DirectX; it's pretty much the industry standard.
Was This Post Helpful? 0
  • +
  • -

#5 Trav  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 210
  • Joined: 01-March 10

Re: DirectX or OpenGL?

Posted 07 March 2010 - 04:50 AM

Ok, I'm choosing DX.

Anyone know of anyone good Books, Tutorials regarding DX?
Was This Post Helpful? 0
  • +
  • -

#6 PlasticineGuy  Icon User is offline

  • mov dword[esp+eax],0
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,436
  • Joined: 03-January 10

Re: DirectX or OpenGL?

Posted 07 March 2010 - 04:51 AM

toymaker.info is the best free DirectX tutorial site in my opinion.
Was This Post Helpful? 0
  • +
  • -

#7 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: DirectX or OpenGL?

Posted 07 March 2010 - 05:01 AM

Didn't know DirectX was the standard, but I'd buy that. However, it is not cross-platform. I understand that soon DirectX will be available for emulation in WINE.(Program to run Windoze apps in Mac and Linux) But even then that requires the user to have to do some tweaking to get it to run. OpenGL should run on pretty much anything with little to no assistance.
Was This Post Helpful? 0
  • +
  • -

#8 PlasticineGuy  Icon User is offline

  • mov dword[esp+eax],0
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,436
  • Joined: 03-January 10

Re: DirectX or OpenGL?

Posted 07 March 2010 - 05:11 AM

Well, pretty much every game I have for Windows has "Requires DirectX" on it.

From past experience I know Trav uses Windows.
Was This Post Helpful? 0
  • +
  • -

#9 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: DirectX or OpenGL?

Posted 07 March 2010 - 05:46 AM

Quote

Well, pretty much every game I have for Windows has "Requires DirectX" on it.

From past experience I know Trav uses Windows.


If its written with DirectX it will say "Requires DirectX" to run it. I've ran OpenGL without installing anything in the Windoze OS. Just droped a couple packages in the Dev-C++ compiler and everything ran with any special instructions.

Trav may use Windoze but for some reason he has the Apple logo as his OS of choice under his avatar. I thought an Apple user may want to know that info.
Was This Post Helpful? 0
  • +
  • -

#10 PlasticineGuy  Icon User is offline

  • mov dword[esp+eax],0
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,436
  • Joined: 03-January 10

Re: DirectX or OpenGL?

Posted 07 March 2010 - 05:49 AM

You're quite right, of course; however, almost every question I've seen him ask relates to the WinAPI.

I would use DirectX simply because I exclusively run Windows, and I like the coding style more.

This post has been edited by PlasticineGuy: 07 March 2010 - 05:50 AM

Was This Post Helpful? 0
  • +
  • -

#11 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: DirectX or OpenGL?

Posted 07 March 2010 - 06:02 AM

DirectX probably has more job opportunities. I would check out what some of the game programmers think though. I can't speak for PlasticineGuy, but I am far from being one.
Was This Post Helpful? 0
  • +
  • -

#12 PlasticineGuy  Icon User is offline

  • mov dword[esp+eax],0
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,436
  • Joined: 03-January 10

Re: DirectX or OpenGL?

Posted 07 March 2010 - 06:05 AM

As am I.

The simple fact is that OpenGL is purely a graphics library, and DirectX encompasses input, graphics and audio.
The Xbox and any of its derivatives that exist or will exist use (a form of) DirectX.

This is an interesting (though indecisive) read: http://en.wikipedia....GL_and_Direct3D.
A quote I find quite important:

Quote

A more substantive and modern performance difference arises because of the structure of the hardware drivers provided by hardware developers. Under DirectX, IHV drivers are kernel-mode drivers installed into the operating system. The user-mode portion of the API is handled by the DirectX runtime provided by Microsoft. Under OpenGL however, the IHV driver is broken into two parts: a user-mode portion that implements the OpenGL API, and a kernel-mode driver that is called by the user-mode portion.

This is an issue because calling kernel-mode operations from user-mode requires performing a system call (i.e. making the CPU switch to kernel mode). This is a slow operation, taking on the order of microseconds to complete.[6] During this time, the CPU is unable to perform any operations. As such, minimizing the number of times this switching operation must be performed would optimize performance. For example, if the GPU's command buffer is full of rendering data, the API could simply store the requested rendering call in a temporary buffer and, when the command buffer is close to being empty, it can perform a switch to kernel-mode and add a number of stored commands all at once. This is known as marshalling.

Because Direct3D IHV drivers are kernel-mode, and the user-mode code is out of the IHV's hand, there is no chance for such optimizations to occur. Because the Direct3D runtime, the user-mode portion that implements the API, cannot have explicit knowledge of the driver's inner workings, it cannot effectively support marshalling. This means that every D3D call that sends commands to the hardware must perform a kernel-mode switch. This has led to a number of behaviors with regard to using D3D, the most important being the need for submitting large batches of triangles in one function call.[7]

Since OpenGL's IHV drivers have a user-mode component to them, IHVs have the ability to implement marshalling, thus improving performance. There is still kernel-mode switching, but the theoretical maximum number of switches under OpenGL implementations is simply equal to the Direct3D standard behavior.

Direct3D 10, the release included with Windows Vista[8], allows portions of drivers to run in user-mode, thus allowing IHVs to implement marshalling, thus bringing the two back into relative performance parity. Mac OS X's OpenGL system is very similar, where IHVs implement a simpler version of the OpenGL API (with both user and kernel mode components), and Apple's additions to the runtime provide the direct interface to the user code, as well as some basic work to make IHVs' jobs easier.


I would say use the "native" library for whichever platform you intend to primarily use. If no such library exists, go for OpenGL.

This is also good (if slightly biased): http://blog.wolfire....and-not-DirectX

This post has been edited by PlasticineGuy: 07 March 2010 - 06:18 AM

Was This Post Helpful? 1
  • +
  • -

#13 besten  Icon User is offline

  • New D.I.C Head

Reputation: 12
  • View blog
  • Posts: 40
  • Joined: 03-March 10

Re: DirectX or OpenGL?

Posted 07 March 2010 - 12:06 PM

WOW, looks like a holly war went between DirectX and OpenGL. :D
Guys, big games are not built only on OpenGL or DirectX. They use a 3D game engine which supports both. Take it easy
Was This Post Helpful? 0
  • +
  • -

#14 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: DirectX or OpenGL?

Posted 07 March 2010 - 09:13 PM

The Xbox and any of its derivatives that exist or will exist use (a form of) DirectX.

True, but Playstation runs Linux. I don't think they use OpenGL, nor DirectX. But if that's what he wants to use cool, more power too him.

EDIT: PS3 does use OpenGL.

No. No holy war, me and PlasticineGuy have made an unspoken truce after the admins ripped on us taking away each others rep points. Believe it or not this is a friendly discussion :) By the way, thanks for putting the past behind us and helping me in my threads!

This post has been edited by Israel: 07 March 2010 - 09:15 PM

Was This Post Helpful? 0
  • +
  • -

#15 besten  Icon User is offline

  • New D.I.C Head

Reputation: 12
  • View blog
  • Posts: 40
  • Joined: 03-March 10

Re: DirectX or OpenGL?

Posted 07 March 2010 - 09:35 PM

Come on Israel! knowledge is knowledge :D The past and the present are made by someone else. I think Amr Diab and Sarit Haddad can make a wonderful duetto only if they listen :D..
Was This Post Helpful? -2
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2