About This Guide
Prev |  | Next

## About This Guide

OpenGL on Silicon Graphics Systems explains how to use the OpenGL graphics library on Silicon Graphics systems. The guide expands on the OpenGL Programming Guide, which describes implementation-independent aspects of OpenGL. It discusses these major topics:

- Integrating OpenGL programs with the X Window System

- Using OpenGL extensions

- Debugging OpenGL programs

- Achieving maximum performance

## What This Guide Contains

This guide consists of 14 chapters and 3 appendixes:

- Chapter 1, “OpenGL on Silicon Graphics Systems,” introduces the major issues involved in using OpenGL on Silicon Graphics systems.

- Chapter 2, “OpenGL and X: Getting Started,” first provides background information for working with OpenGL and the X Window System. You then learn how to display some OpenGL code in an X window with the help of a simple example program.

- Chapter 3, “OpenGL and X: Examples,” first presents two example programs that illustrate how to create a window using IRIS IM or Xlib. It then explains how to integrate text with your OpenGL program.

- Chapter 4, “OpenGL and X: Advanced Topics,” helps you refine your programs. It discusses how to use overlays and popups. It also provides information about pixmaps, visuals and colormaps, and animation.

- Chapter 5, “Introduction to OpenGL Extensions,” explains what OpenGL extensions are and how to check for OpenGL and GLX extension availability.

- Chapter 6, “Resource Control Extensions,” discusses extensions that facilitate management of buffers and similar resources. Most of these extensions are GLX extensions.

- Chapter 7, “Texturing Extensions,”explains how to use the texturing extensions, providing example code as appropriate.

- Chapter 8, “Rendering Extensions,” explains how to use extensions that allow you to customize the system's behavior during the rendering portion of the graphics pipeline. This includes blending extensions; the sprite, point parameters, reference plane, multisample, and shadow extensions; and the fog function and fog offset extensions.

- Chapter 9, “Imaging Extensions,” explains how to use extensions for color conversion (abgr, color table, color matrix), the convolution extension, the histogram/minmax extension, and the packed pixel extension.

- Chapter 10, “Video Extensions,” discusses extensions that can be used to enhance OpenGL video capabilities.

- Chapter 11, “Miscellaneous OpenGL Extensions,” explains how to use the instruments and list priority extensions as well as two extensions to GLU.

- Chapter 12, “OpenGL Tools,” explains how to use the OpenGL debugger (ogldebug) and discusses the glc OpenGL character renderer and (briefly) the gls OpenGL Streaming codec.

- Chapter 13, “Tuning Graphics Applications: Fundamentals,” starts with a list of general debugging hints. It then discusses basic principles of tuning graphics applications: pipeline tuning, tuning animations, optimizing cache and memory use, and benchmarking. You need this information as a background for the chapters that follow.

- Chapter 14, “Tuning the Pipeline,” explains how to tune the different parts of the graphics pipeline for an OpenGL program. Example code fragments illustrate how to write your program for optimum performance.

- Chapter 15, “Tuning Graphics Applications: Examples,” provides a detailed discussion of the tuning process for a small example program. It also provides a code fragment that's helpful for drawing pixels fast.

- Chapter 16, “System-Specific Tuning,” provides information on tuning some specific Silicon Graphics systems: low-end systems, Indigo2 IMPACT systems, and RealityEngine systems. In this revision, it also includes information on O2 and InfiniteReality systems.

- Appendix A, “OpenGL and IRIS GL,” helps you port your IRIS GL program to OpenGL by providing a table that contrasts IRIS GL functions and equivalent OpenGL functionality (including extensions).

- Appendix B, “Benchmarks,” lists a sample benchmarking program.

- Appendix C, “Benchmarking Libraries: libpdb and libisfast,” discusses two libraries you can use for benchmarking drawing operations and maintaining a database of the results.

- Appendix D, “Extensions on Different Silicon Graphics Systems,” list all extensions currently supported on InfiniteReality, Impact, OCTANE, and O2 systems.

Note that although this guide contains information useful to developers porting from IRIS GL to OpenGL, the primary source of information for porting is the OpenGL Porting Guide, available from Silicon Graphics (and via the IRIS Insight viewer or the TechPubs library home page online).

## What You Should Know Before Reading This Guide

To work successfully with this guide, you should be comfortable programming in ANSI C or C++. You should have a fairly good grasp of graphics programming concepts (terms such as “texture map” and “homogeneous coordinates” aren't explained in this guide), and you should be familiar with the OpenGL graphics library. Some familiarity with the X Window System, and with programming for Silicon Graphics platforms in general, is also helpful. If you're a newcomer to any of these topics, see the references listed under “Background Reading.”

## Background Reading

The following books provide background and complementary information for this guide. Bibliographical information or the Silicon Graphics document number is provided. Books available in hardcopy and by using the IRIS InSight online viewer are marked with (I):

### OpenGL and Associated Tools and Libraries

- Kilgard, Mark J. OpenGL Programming for the X Window System. Menlo Park, CA: Addison-Wesley Developer's Press. 1996. ISBN 0-201-48369-9.

- Woo, Mason, Jackie Neider and Tom Davis. OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 1.1. Reading, MA: Addison Wesley Longman Inc. 1997. ISBN 0-201-46138-2. (I)

- OpenGL Architecture Review Board; Renate Kempf and Chris Frazier, editors. OpenGL Reference Manual. The Official Reference Document for OpenGL, Version 1.1. Reading, MA: Addison Wesley Longman Inc. 1996. ISBN 0-201-46140-4.

- OpenGL Porting Guide (007-1797-030). (I)

- IRIS IM Programming Guide (007-1472-020)

### X Window System: Xlib, X Toolkit, and OSF/Motif

- O'Reilly X Window System Series, Volumes 1, 2, 4, 5, and 6 (referred to in the text as “O'Reilly” with a volume number):

  - Nye, Adrian. Volume One: Xlib Programming Manual. Sebastopol, CA: O'Reilly & Associates, 1991. (I)

  - Volume Two. Xlib Reference Manual. Sebastopol, CA: O'Reilly & Associates.

  - Nye, Adrian, and Tim O'Reilly. Volume Four. X Toolkit Intrinsics Programming Manual. Sebastopol, CA: O'Reilly & Associates, 1992. (I)

  - Flanagan, David (ed). Volume Five. X Toolkit Intrinsics Reference Manual. Sebastopol, CA: O'Reilly & Associates, 1990.

  - Heller, Dan. Volume Six. Motif Programming Manual. Sebastopol, CA: O'Reilly & Associates.

- Young, Doug. Application Programming with Xt: Motif Version

- Kimball, Paul E. The X Toolkit Cookbook. Englewood Cliffs, NJ: Prentice Hall, 1995.

- Open Software Foundation. OSF/Motif Programmer's Guide, Revision 1.2. Englewood Cliffs, NJ: Prentice Hall, 1993. (I)

- Open Software Foundation. OSF/Motif Programmer's Reference, Revision 1.2. Englewood Cliffs, NJ: Prentice Hall, 1993. (I)

- Open Software Foundation. OSF/Motif User's Guide, Revision 1.2. Englewood Cliffs, NJ: Prentice Hall, 1993.

- Open Software Foundation. OSF/Motif Style Guide. Englewood Cliffs, NJ: Prentice Hall. (I)

### Other Sources

- Kane, Gerry. MIPS RISC Architecture. Englewood Cliffs, NJ: Prentice Hall. 1989.

- MIPS Compiling and Performance Tuning Guide. 007-2479-001. (I)

## Conventions Used in This Guide

This section explains the typographical and function-naming conventions used in this guide.

### Typographical Conventions

This guide uses the following typographical conventions:

`Italics` |  | Filenames, IRIX command names, function parameters, and book titles.
`Fixed-width` |  | Code examples and system output.
`Bold` |  | Function names, with parentheses following the name—for example `glPolygonMode()`, arguments to command line options.

| Note: Names of reference pages, such as glPolygonMode, are not functions. Reference page names appear in default font in hardcopy and in red text online. If you click the red text, the reference page will launch automatically.

### Function Naming Conventions

This guide refers to a group of similarly named OpenGL functions by a single name, using an asterisk to indicate all the functions whose names start the same way. For instance, `glVertex*()` refers to all functions whose names begin with “glVertex”: `glVertex2s()`, `glVertex3dv()`, `glVertex4fv()`, and so on.

Naming conventions for X-related functions can be confusing, because they depend largely on capitalization to differentiate between groups of functions. For systems on which both OpenGL and IRIS GL are available, the issue is further complicated by the similarity in function names. Here's a quick guide to old and new function names:

`GLX*()` |  | IRIS GL mixed-model support
`Glx*()` |  | IRIS GL support for IRIS IM
`glX*()` |  | OpenGL support for X
`GLw*()` |  | OpenGL support for IRIS IM

Note that the (OpenGL) `glX*()` routines are collectively referred to as “GLX”; that term was previously used to refer to the (IRIS GL) `GLX*()` routines. Note, too, that `GLXgetconfig()` (an IRIS GL mixed-model routine) is not the same function as `glXGetConfig()` (a GLX routine). On systems with both IRIS GL and OpenGL, the command

    IRIS% man glxgetconfig

displays both reference pages, one following the other.

## Changes in this Version of the Manual

This first revision of the manual contains the following changes:

- Extensions removed. The manual has been updated for OpenGL 1.1. The functionality of some extensions was integrated into OpenGL 1.1 and the extensions have therefore been removed:

  Texturing extensions | Texture objects, subtexture, copy texture.
  Imaging extensions | Blend logic op
  Miscellaneous extensions | Polygon offset, vertex array

- Extensions added. The extension chapters have been reorganized as a finer-grained presentation. A number of extensions have been added:

  Resource extensions | DMPbuffer extension
  Texturing extensions | Texture filter4, filter4 parameters, texture LOD Bias, texture multibuffer, clipmap, texture select, texture add environment
  Rendering extensions | Sprite, point parameters, reference plane, fog function, fog offset, shadow
  Imaging extensions | Pixel texture
  Video extensions | Swap barrier, swap group, video resize

- Tools: The chapter discussing ogldebug, the OpenGL Debugger, has been updated to reflect ogldebug 1.1. In addition, a section on glc, the OpenGL character renderer, and gls, the OpenGL streaming utility, have been added to the chapter.

- Performance: The performance chapters have been updated to include some additional information, most notably on InfiniteReality and O2 systems.

Prev | Table of Contents | Next
OpenGL® on Silicon Graphics® Systems |  | Chapter 1. OpenGL on Silicon Graphics Systems