OpenGL and Direct3D are two programming libraries that provide fast and direct access to the computer's graphics hardware, and allow for fast hardware-accelerated 3D rendering.
OpenGL is the older of the two, and was initially intended to be a general-purpose API for any 3D rendering application. Its philosophy has been to offer support for any feature even if the hardware does not implement that feature. The feature would have been emulated if it wasn't available. However with the coming of hardware accelerated rendering, the focus has been more on the advanced features these graphics cards offer. OpenGL is standardised and has been implemented on many platforms; it is currently available on Windows, Linux, Mac OS X and many others. As an API, OpenGL is normally implemented in C, and built around a state machine. Very few of the function calls have return values or error codes, so using OpenGL comes down to 'sending stuff down the line'.
Direct3D was developed exclusively by Microsoft as a part of DirectX. Right from the start its aim was to provide an interface to the graphics hardware, and was designed with games in mind. The API itself is written in C, and is similar to the standard Win32 API. This means function calls with 5-10 parameters on average, lots of typedefs, and general code management havoc. A major downside of Direct3D is that it's not portable, so using it automatically ties any game to Windows only. Its integration with Win32 also gives problems for those wanting to use something other than Win32 instead.
I think the non-portability of Direct3D automatically disqualifies it as a viable alternative. Portability is a big issue nowadays, and it's stupid to think Windows is the only platform out there. From what I've seen of Direct3D it's also rather messy (as most Microsoft code is), while OpenGL is very clean and neatly designed overall. Perhaps the only real thing lacking with OpenGL is any form of object-oriented programming, but its implementation as a state machine does simplify the approach somewhat and makes it easy to manage.
0
OpenGL vs Direct3D: the debate
Started By CodeCat, May 02 2009 10:14
1 reply to this topic
3 user(s) are reading this topic
0 members, 3 guests, 0 anonymous users