18 February, 2008

OpenGL/OpenAL or DirectX ?

A lot of people would probably just stare at me with a stupid look if I ever mentioned the sentence "OpenGL versus DirectX?". But for those of you out there that know what I'm talking about, comments are welcomed! ;)

I believe that putting a compatability layer on top of a complex API is a good thing. But when that layer constricts to only one platform and system, what's the point?

When designing 3D games for DirectX (3D/2D/audio compatability layer for Windows developed especially for games and multimedia applications), you program the game/application to only work under Windows, unless you use wine on Linux for example.

But if you program the 3D to work under OpenGL, you make the code cross-platform, i.e.: it works under every system that supports OpenGL APIs, and that's about every computer that has an OpenGL compliant graphics card installed. I've always admired ID Software for doing this, because when they eventually released Doom III, they just had to release a rather small client application for running the game under Linux/BSD/OS X, rather than adding yet another API layer between Windows-only software to make it work on Linux platforms.

It's the same thing with audio using
OpenAL, developed by Creative (yes, the big-time gamer soundcard manufacturer and audio-effects technology company). Same concept, only, using the native OS sound-drivers to make use of audio resources, like OpenGL utilizes embedded APIs in graphics cards to perform optimized. OpenAL even supports Windows Vista at the time of writing, so, what is holding back cross-platform development in this area?

How about an embedded audio layer API in soundcards, just like OpenGL in graphics cards? Then we can just deprecate DirectX as useless and overbloated technology alltogether, and live together i harmony? Not that I foresee this happening...

Personally, I believe if game developer companies realized the market potential of Linux gamers, they would have cashed in on this market years ago. If they don't have the programmers needed to create this kind of software, they could always have open source developers create client applications for them.

The question(s) then becomes:

  • Should game developer companies roll out the cash for this unusual programming-style in their games if already set on DirectX approaches?
  • Reverse the 3D API and audio API approach and base everything on OpenGL and OpenAL?
  • Or just continue as before, basing everything on Microsoft's proprietary API layers?
Well, I don't have any applicable answers, I'm not a game programmer. Actually I'm not that good a programmer at all, it's more of a hobby than an ambition. But I have burning desires and visions about game programming in general.

Cross-developing is not a bad thing, both commercially and ethically. It makes the games more accessible for a wider usergroup, than restricting it to a specific platform or system.

Game programming is much like application programming, if you develop code to run in a specific environment, it requires a lot of third-party support to run elsewhere.

This article covers best what I'm trying to explain here:
http://en.wikipedia.org/wiki/Direct3D_vs._OpenGL

Microsoft (DirectX creator and advocate) and SGI (OpenGL creator and advocate), engaged in a so-called "API War" after both API layers were created. The result boiled down to an optimization-battle; which API out-performed the other? No questions about which API would be the best to implement for business, or which would encourage more development of computer games, no, it was simply a performance-question. Stupid...

My main basis for this post, are the questions:

"Why use DirectX, when OpenGL gives a direct API for controlling the graphics card natively through the OS?
Why go the long-run and use DirectX making the whole process jump two APIs before ending at the specified resource?"

and

"Like OpenGL, OpenAL provides an API compatability layer that controls audio-resources at lower levels for better output results just like DirectX, only, it's freely available to redistribute, AND it's developed by one of the biggest soundcard manufacturers out there.., Creative. Is this not a better solution?"

What's even more frustrating, is that both these APIs offer free developer kits for both Linux and Windows. (OpenAL even offers developer kits for Xbox 360 and MacOS! Check out developer.creative.com)

I was recently made aware that DirectX is not only used on computers running Windows OSes, it is also used in their console-systems Xbox and Xbox 360. Well-well "M$", splitting the market are we...?

I can understand the arguments "it makes development easier and faster" and "DirectX provides API functions even before the equipment incorporates it", but these are not really valid points in my book. Firstly, making things "easy & quick" ain't the same as doing it right. And providing API functions before the hardware? Please.., what the hell is the point of that?

You could argue for the use of DirectX on the basis of it implementing audio-features not available in for example OpenAL. Then again, why not put all that development effort into open source projects JUST LIKE OpenAL instead of DirectX? It's all for a common goal! To let people regardless of operating systems and platforms to enjoy the same entertainment! Is this so extremely bad for business?

In my opinion, this is exactly like the battle regarding CSS encryption on DVDs a few years back, not letting Linux users enjoy the same entertainment as the rest of consumers that OWN standalone DVD-players or DVD-ROMs with DeCSS software, forcing Linux users and developers to reverse engineer the algorithm and implement it using copyleft code.

...Instead of the movie-industry just allowing Linux users the right to use their own DVDs on their computers, they just said: "Well, that's not our responsibility, if you want to view DVDs on a computer, buy Windows..."

Can I presume a conflict of interest between the computer and entertainment industry?
*Sigh* ...ain't THIS old news...shiiit...

0 kommentarer :

Post a Comment