Understanding OpenGL

OpenGL (originally called Open Graphics Library) is a 2D and 3D graphics API that was developed by Silicon Graphics Inc. (SGI) for its Unix workstations. Although SGI's version of OpenGL has been around for a long time, the first standardized spec of OpenGL emerged in 1992. Now widely adopted on all operating systems, the OpenGL standard forms the basis of much of the gaming, computer-aided design (CAD), and even virtual reality (VR) industries.

The OpenGL standard is currently being managed by an industry consortium called The Khronos Group (http://www.khronos.org), founded in 2000 by companies such as NVIDIA, Sun Microsystems, ATI Technologies, and SGI. You can learn more about the OpenGL spec at the consortium's web site:


The official documentation page for OpenGL is available here: http://www.opengl.org/documentation/

As you can see from this documentation page, you have access to many books and online resources dedicated to OpenGL. Of these, the gold standard is OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 1.1, also known as the "red book" of OpenGL. You can find an online version of this book here:


We recommend this book highly. Unlike many other OpenGL books, this book is eminently readable. We did have some difficulty, however, unraveling the nature of units that are used to draw. Perhaps the authors thought it was a simpler concept than it is. We'll try to clarify the important ideas regarding what you draw and what you see in OpenGL. These ideas center on setting up the OpenGL camera and setting up a viewing box, also known as a viewing volume or frustum.

While we are on the subject of OpenGL, we should talk a little bit about Direct3D, which is part of Microsoft's DirectX API. It's likely that Direct3D will be the standard on Windows-based mobile devices. Moreover, because OpenGL and Direct3D are similar, you could even read books about Direct3D to get an understanding of how 3D drawing works.

This Direct3D standard, which emerged from Microsoft in 1996, is programmed using COM (Component Object Model) interfaces. In the Windows world, you use COM interfaces to communicate between different components of an application. When a component is developed and exposed through a COM interface, any development language on the Windows platform can access it, both from inside and outside the application. In the Unix world, CORBA (Common Object Request Broker Architecture) plays the role that COM plays for Windows.

OpenGL, on the other hand, uses language bindings that look similar to their C language counterparts. A language binding allows a common library to be used from many different languages such as C, C++, Visual Basic, Java, and so on.

Both the OpenGL and Direct3D standards are converging in their capabilities, but you might face a different learning curve because OpenGL is a C API whereas Direct3D is a COM interface. Plus, you'll see differences in their rendering semantics, which are the approaches used inside the library to paint (roughly) a graphic scene.

Let us now talk about OpenGL ES, the version of OpenGL geared toward the mobile platform.

0 0

Post a comment