This guide tells you how to port your existing IRIS GL code to OpenGL. It
describes how to use the toogl automatic translation script
lists OpenGL equivalents for IRIS GL calls
describes how to reimplement IRIS GL windowing code using the X Window System and IRIS IM APIs (IRIS IM is the Silicon Graphics port of the industry-standard OSF/Motif software)
provides basic information for working with the X Window System
This guide is for developers who have been using IRIS GL. It is not an introduction to graphics programming and it is not comprehensive OpenGL documentation. For more complete OpenGL documentation, see “OpenGL Documentation”.
![]() | Note: This guide is written for programmers who are working in C. It doesn't discuss OpenGL Fortran and Ada wrappers. |
This guide includes the following chapters:
Chapter 1, “Introduction to Porting From IRIS GL to OpenGL,” describes some of the major differences between IRIS GL and OpenGL, lists the Silicon Graphics tools you can use to facilitate the transition, and provides some general porting instructions.
Chapter 2, “Using the toogl Tool,” explains how to use the automatic translation tool, which can do much of the porting work for you.
Chapter 3, “After toogl: How to Finish Porting to OpenGL,” discusses IRIS GL commands that might need some extra porting attention, giving command equivalents and providing porting tips for each.
Chapter 4, “OpenGL in the X Window System,” describes two methods for using the X Window System™ to manage windows and events with OpenGL: using Xt and the Silicon Graphics IRIS IM widget or using Xlib.
Appendix A, “OpenGL Commands and Their IRIS GL Equivalents,” is a complete alphabetical list of IRIS GL calls and their OpenGL equivalents (if an equivalent exists) along with cross-references to documentation, where available.
Appendix B, “Differences Between OpenGL and IRIS GL,” provides a more complete list of the differences between OpenGL and IRIS GL than Chapter 1 offers.
Appendix C, “OpenGL Names, Types, and Error,” explains OpenGL naming conventions, lists OpenGL defined types, and describes error handling in OpenGL.
Appendix D, “Example OpenGL Program With the GLUT Library,” provides an example OpenGL program that uses the GLUT library for windowing and event handling.
Appendix E, “Example Program Using Xt and a WorkProc,” provides an example OpenGL program using Xt, IRIS IM, and the Silicon Graphics widget. The program demonstrates the use of a WorkProc for animation.
Appendix F, “Example Mixed-Model Programs With Xlib,” provides two example mixed-model programs using Xlib. Each program is shown in both IRIS GL and OpenGL form.
As you use this guide, you will probably have to refer to the OpenGL reference pages, the IRIS GL reference pages, and the programming guides. You can read all the reference pages online using the man command, or you can buy the printed OpenGL reference pages. These are published in the OpenGL Reference Manual, available in bookstores (see “OpenGL Documentation”).
![]() | Note: If you're viewing this manual online using IRIS InSight, click any red underlined reference page name to view the reference page. |
In addition, you may find the OpenGL documentation, GLUT documentation, IRIS GL documentation, and window system documentation that's listed in the following sections helpful:
For more information on programming in OpenGL 1.1, refer to these manuals:
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
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
OpenGL on Silicon Graphics Systems (Silicon Graphics manual; document number 007-2392-002)
For more information on programming in OpenGL 1.0, refer to these manuals:
OpenGL Architecture Review Board. OpenGL Reference Manual. Reading, MA: Addison-Wesley Publishing Company. 1992. ISBN 0-201-63276-4
Neider, Jackie, Tom Davis, and Mason Woo. OpenGL Programming Guide. Reading, MA: Addison-Wesley Publishing Company. ISBN 0-201-63274-8
OpenGL on Silicon Graphics Systems (Silicon Graphics manual; document number 007-2392-001)
Kilgard, Mark J. OpenGL Programming for the X Window System. Menlo Park, CA: Addison-Wesley Developer's Press. 1996. ISBN 0-201-48369-9
Pointers to the GLUT Library, to interesting technical papers, and to the comp.graphics.opengl mailing list are on the OpenGL home page: http://www.openGL.org/
For more information on programming with IRIS GL, refer to these Silicon Graphics manuals:
Graphics Library Programming Guide, Volume 1 (document number 007-1210-060)
Graphics Library Programming Guide, Volume 2 (document number 007-1702-020)
Graphics Library Programming Tools and Techniques (document number 007-1489-030)
For comprehensive information on the X Window System, Xlib, Xt, and X protocol, see the Digital Press X Series:
Scheifler, Robert W., and James Gettys, et al. X Window System: The Complete Reference to Xlib, X Protocol, ICCCM, XLFD. Third Edition, X Version 11, Release 5, Burlington, MA. Digital Press—Digital Equipment Corporation, 1992. ISBN 1-55558-088-2
Asente, Paul J., and Ralph R. Swick. X Window System Toolkit: The Complete Programmer's Guide and Specification. Burlington MA: Digital Press—Digital Equipment Corporation. 1992. ISBN 1-55558-051-3
Or refer to the O'Reilly X Window System Series, Volumes 1, 4, and 5:
Nye, Adrian. Volume One: Xlib Programming Manual. Sebastopol, CA. O'Reilly & Associates. 3rd edition July 1992. ISBN 1-56592-002-3
Nye, Adrian, and Tim O'Reilly. Volume Four: X Toolkit Intrinsics Programming Manual. Sebastopol, CA: O'Reilly & Associates. Second edition, 1992. ISBN 1-56592-013-9
Flanagen, David (editor). Volume Five: X Toolkit Intrinsics Reference Manual. Sebastopol, CA: O'Reilly & Associates. Third edition, April 1992. ISBN 1-56592-007-4
For information on OSF/Motif, see the Prentice-Hall OSF/Motif series:
OSF/Motif Programmer's Guide, Open Software Foundation, PTR Prentice-Hall, Inc., Englewood Cliffs, NJ.
OSF/Motif Programmer's Reference, Open Software Foundation, PTR Prentice-Hall, Inc., Englewood Cliffs, NJ.
OSF/Motif Style Guide, Open Software Foundation, PTR Prentice-Hall, Inc., Englewood Cliffs, NJ.
This section explains the typographical and function naming conventions used in this guide.
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()—and arguments to command-line options. |
![]() | Note: In all tables, regular font is used for function names. This avoids clutter in the table, which would make it difficult to read. |
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 |
This version of the document has been updated in the following ways:
All references to the aux library have been removed and replaced with references to the GLUT library where appropriate. The aux library was never intended for production-level code. Its removal from this document intends to discourage programmers from continuing to use it.
All examples were updated to use the glut library instead of the aux library.
This document is targeted at both OpenGL 1.0 and OpenGL 1.1 users. It refers to OpenGL 1.1 functions where new functionality has been introduced (old references to extensions remain where appropriate).
Most references to reference pages are now links when viewed with IRIS Insight.
Chapter and section overviews with links to sections or subsections have been added.
Appendix B, Differences Between OpenGL and IRIS GL, was updated to contain the most recent information supplied by Mark Kilgard.