OpenGL -

The Integration of Windowing and 3D Graphics



by Harry Shamansky

A Look Back

Years ago, many scientists, engineers and others discovered the power and benefits of 3D graphics. They also discovered, after expending a large amount of time and effort, that the "language" used to harness the graphics display system often was not well suited to integration with other tasks which they faced.

Nowhere was this more true in the case of 3D graphics and windowed environments. In fact, I can remember a number of years ago that one vendor at the SIGGRAPH annual conference stated that there were no 3D graphics available inside a windowed environment. He was wrong, Tektronix had created a first attempt at having a co-existence of 3D graphics with X-Windows, but his comment indicated the state of the graphics world for the most part, at that time. But this first attempt was a crude one; there was no concept of integration between the two ideas, namely 3D graphics and windowed environments.

Nowadays, the mere appearance of a character user interface is an oddity; virtually all computers (from inexpensive PC's to world class graphics workstations) have some form of windowing environment. Some systems cater to the user who want to use the 3D graphics, but the issue of using the hardware accelerated 3D graphics and the windowing environment poses some unique concerns. While for a time, users were content to live with two dissimilar and often entirely incompatible environments, today, users demand interoperability, portability and no loss in performance.

In this article, one such graphics interface, OpenGL, is discussed in terms of its capabilities of delivering a feature-rich graphical programming language in a vendor-neutral form, and its ability to be interfaced with various windowing systems.

OpenGL as an Application Programming Interface (API)

While the X Window System has become the de facto display management standard in the UNIX workstation market, OpenGL was designed to be window system neutral and vendor neutral. This means that other windowing environments, like NT/Windows, are also well suited to support OpenGL. This is a very important benefit, and is possible since the OpenGL specification is independent of
  1. window system
  2. operating system
  3. network
In addition, all implementations of OpenGL, regardless of vendor, must be fully conforming to the basic standard, so the user/programmer is assured that all basic features and functions will be available on all different platforms. Each implementor is required to run and pass a suite of conformance tests to ensure source code compatibility across all OpenGL implementations.

As an example of the neutrality of OpenGL, consider the list of vendors who support OpenGL. As of December, 1995, the list of OpenGL licensees (from the Frequently Asked Questions (FAQ) opengl-faq, with updates from John Schimpf, jsch@asd.sgi.com):

OpenGL itself is controlled by an industry consortium, the OpenGL Architectural Review Board. Members from major hardware and software vendors jointly guide the growth and development of OpenGL, thus assuring that no one vendor dictate the direction on OpenGL.

In addition, the ARB approved the OpenGL 1.1 spec in December. This is the first update to the OpenGL specification since it was first released. Along with OpenGL 1.1, GLX 1.2 will be released in February.

What OpenGL is Not

OpenGL is not:
  1. A Tool Kit or high-level Application Programming Interface
  2. A Windowing System
  3. A Descriptive Graphics System
  4. Object Oriented
OpenGL knows nothing of tool kits, although there are tool kits for OpenGL. It is also not a windowing system, and is dependent on a window system to do all the window related tasks (like creating the canvas, dealing with input from the user, etc.) OpenGL is not descriptive, that is the programmer does not set up a model of the scene to be rendered, and then let the graphics system handle the task of doing the drawing. And finally, OpenGL is not object oriented (but there is a object-oriented 3D graphics toolkit, Open Inventor , available from Silicon Graphics, for example).

What OpenGL is

OpenGL is:
  1. An Immediate Mode System
  2. Application Format Flexible
  3. A Procedural System
  4. Display List Functional
OpenGL is an immediate mode system, that is commands are executed essentially immediately. OpenGL accepts various data types, freeing the programmer from needless conversions. It is procedural in that the programmer issues specific commands to determine what is actually drawn. And it supports non-editable display lists for better network extensibility, resulting in improved performance across server/client applications, as well as improved direct rendering.

How OpenGL Solves the Interface Dilemma

Since OpenGL is window system independent, it does not have to be concerned (too much) with the window system details itself. For each window system which OpenGL is adapted to, a very limited set of "glue" routines are specified, and the remaining core of OpenGL remains identical across all window systems.

This core API is dedicated to the basic rendering functionality, but there exist a number of other aspects of graphics which are not strictly rendering. To address these needs, the OpenGL standard also provides the OpenGL Utility Library (GLU), with routines for the following tasks:

When considering the X Window System, OpenGL provides a formal X Extension - GLX. GLX provides the means of "gluing" together OpenGL and X. It also defines the wire protocol for supporting OpenGL as an X server extension, thus allowing an OpenGL application running on one workstation to be rendered on another host, much the same way the standard X protocol supports 2D graphics interoperability.

While GLX works alongside the X Window System, it also has a much more sophisticated concept of what the graphics hardware can do. X treats the fundamental graphics canvas (called a drawable, either a window or an off-screen pixmap) as an array of 2D pixels, but GLX expands this by including capabilities of the OpenGL framebuffer (i.e. the graphics hardware). So models like stereoscopic viewing (where the perception of depth is conveyed using separate images to the left and right eyes) and double buffering (useful for animation) can be supported. Even direct access to the graphics hardware is supported by GLX.

Thus the promise of a very capable graphical user interface (using Motif, or Windows, etc.) integrated with a powerful 3D graphics rendering is readily accomplished. The end user sees the graphical user interface, with its point and click layout, and also a sophisticated, feature-rich 3D display of the images, or scientific data that the application needs to display. The programmer no longer needs to be concerned with the interaction of the 3D graphics and the window interface; these aspects are essentially isolated, and OpenGL takes care of the synchronization of these two processes. Additionally, the programmer is assured that his/her application will portably run on a wide range of graphics platforms and operating systems, thereby promoting even wider use of 3D graphics in various applications.

Where to go to find more information

A 2 volume set, The OpenGL Technical Library, is published by Addison-Wesley. The OpenGL Reference Manual is ISBN 0-201-63276-4. The OpenGL Programming Guide is ISBN 0-201-63274-8.

Also, the USENET news group comp.graphics.opengl is a wealth of information regarding OpenGL aspects. Some additional references are:

  1. Davis, Tom. "Moving to OpenGL," IRIS Universe, Number 25, Summer, 1993.
  2. Glazier, Bill. "The 'Best Principle': Why OpenGL is emerging as the 3D graphics standard," Computer Graphics World, April, 1992.
  3. Karlton, Phil. "Integrating the GL into the X environment: a high performance rendering extension working with and not against X," The X Resource: Proceeding of the 6th Annual X Technical Conference, O'Reilly Associates, Issue 1, Winter, 1992.
  4. Kilgard, Mark J. "OpenGL & X: An Introduction," The X Journal. November-December, 1993, page 36-51.
  5. Kilgard, Mark J. "Using OpenGL with Xlib," The X Journal. January-February, 1994, page 46-65.
  6. Kilgard, Mark J. "OpenGL and Motif Integration," The X Journal. to appear.
  7. Neider, Jackie, Tom Davis, and Mason Woo, OpenGL Programming Guide: The Official Guide to Learning OpenGL, Release 1, Addison-Wesley, Reading, Massachusetts, 1993.
  8. OpenGL Architecture Review Board, OpenGL Reference Manual: The Official Reference Document for OpenGL, Release 1, Addison-Wesley, Reading, Massachusetts, 1992.
  9. "OpenGL Programs a New Horizon for Sun," SunWorld, January, 1994, page 15-17.

hts@hertz.eng.ohio-state.edu


Last updated Fri Dec 29 12:59:48 EDT 1995.