| ★ wanayoo — archive 1999 http://reality.sgi.com/opengl/OpenGLforX.html | Nouvelle recherche | Portail wanayoo |

ORDER online right now from: amazon.com, Book Pool, Computer Literacy
Larger Front Cover Image
Back Cover Image
OpenGL is the fastest and most widely available software standard for producing high-quality color images of 3D scenes. This practical guide shows X programmers how to construct working 3D applications using OpenGL and how to tightly integrate OpenGL applications with the X Window System.
Written by a Silicon Graphics X Window System and OpenGL expert, OpenGL Programming for the X Window System uses the OpenGL Utility Toolkit (GLUT) to show how OpenGL programs can be constructed quickly and explores OpenGL features using examples written with GLUT. This book also:
Each chapter contains source code demonstrating the techniques described. Source code for all the examples provide, and for the GLUT library itself, are available for downloading via the Internet.
Intended for X programmers familiar with the Xlib and/or Motif programming interfaces. No previous OpenGL knowledge is required.
Mark Kilgard is a member of the Technical Staff at Silicon Graphics, Inc. He is a contributor to The X Journal and speaks regularly at the X Technical Conference and SIGGRAPH. Mark is also the creator of the OpenGL Utility Toolkit (GLUT).
Compressed Unix tar files containing the book's Xlib-based, Motif-based, and GLUT-based source code examples are available.
For the Xlib-based examples, download: xlib.tar.Z For the Motif-based examples, download: motif.tar.Z For the GLUT-based examples, download: glut.tar.Z
The GLUT tar file also contains the source code for GLUT 3.1 and the GLUT specication.
This book is available from your local computer-literate bookstore, or you can purchase a copy directly from Addison-Wesley by calling 1-800-822-6339.
Preface
Acknowledgements
1 Introduction
1.1 What is OpenGL?
1.1.1 OpenGL's Design
1.1.2 History of OpenGL
1.2 OpenGL's Rendering Functionality
1.2.1 Geometric Primitives
1.2.2 Pixel Path Operations
1.2.3 Two Color Models
1.2.4 OpenGL Modes and Other State
1.2.5 Ancillary Buffers
The Depth Buffer
The Stencil Buffer
The Accumulation Buffer
Double Buffering
Stereo
1.2.6 Modeling and Viewing
1.2.7 Further Capabilities
1.3 GLX: The Glue Between OpenGL and X
1.3.1 A Quick Survey of GLX
1.3.2 The GLX Protocol
1.4 The GLU Library
1.5 An Example Xlib-based OpenGL Program
1.5.1 Initialization
1.5.2 Example: glxsimple.c
1.5.3 Scene Update
1.5.4 Compiling the Example
1.6 Comparing OpenGL to PEX
1.6.1 Subsets and Baselines
1.6.2 Programming Interfaces
1.6.3 Rendering Functionality
1.6.4 Display Lists
1.6.5 Portability
1.6.6 Window System Dependency
2 Integrating X and OpenGL
2.1 A More Involved Xlib Example
2.1.1 Initialization
Choosing a Visual and Colormap
Creating a Rendering Context
Setting Up a Window
2.1.2 The Dinosaur Model
The GLU Tessellator
Hierarchical Display Lists
Context Initialization
Back-face Culling
2.1.3 Lighting
Types of Lighting
Lighting in the Example
2.1.4 View Selection
2.1.5 Event Dispatching
Expose Handling
Window Resizing
Handling Input
Quitting
Compiling glxdino
2.2 OpenGL and X Visuals
2.2.1 What Visuals GLX Guarantees to Exist
2.2.2 Example: glxvisuals.c
2.2.3 glXChooseVisual and glXGetConfig
2.3 More about Colormaps
2.3.1 Colormap Sharing
2.3.2 Managing Multiple Colormaps
2.3.3 Initializing Writable Colormaps
2.4 Using GLX Contexts
2.4.1 Sharing Display Lists
2.4.2 Binding to GLX Contexts
2.4.3 Copying Context State
2.5 Rendering X Fonts with OpenGL
2.6 Rendering OpenGL into Pixmaps
2.6.1 Generating Encapsulated PostScript
2.7 Mixing X and OpenGL Rendering
2.8 Debugging Tips
2.8.1 Finding OpenGL Errors
2.8.2 X11 Protocol Errors
2.8.3 Specialized OpenGL Debugging Tools
3 Using OpenGL with Widgets
3.1 About the X Toolkit and Motif
3.2 Using OpenGL Drawing Area Widgets
3.2.1 A Short OpenGL-specific Widget Example
Widget Initialization
Callbacks
Compiling glw
3.3 Specifics of the OpenGL Drawing Area Widgets
3.3.1 The Motif and non-Motif OpenGL Widget Differences
3.3.2 OpenGL Widgets and the Widget Class Hierarchy
3.3.3 OpenGL Widget Resources
3.3.4 OpenGL Widget Advice
3.4 A More Involved Widget Example
4 A Simple Toolkit for OpenGL
4.1 Introducing GLUT
4.1.1 A Short Example
Compiling glutsphere
4.1.2 User Input and Other Callbacks
4.1.3 Menus
4.2 More GLUT Functionality
4.2.1 Subwindows
4.2.2 Window Management
4.2.3 Controlling the Cursor Shape
4.2.4 Color Index Mode
4.2.5 Other Input Device Callbacks
4.2.6 State Retrieval
4.2.7 More Menu Management
4.2.8 Font Rendering
4.2.9 Geometric Shape Rendering
4.2.10 Overlay Support
4.3 Usage Advice and Hints
4.3.1 Callback Advice
4.3.2 Window Management Advice
4.3.3 Current Window/Menu Management Advice
4.3.4 Miscellaneous Advice
4.4 A Substantial GLUT Example
4.4.1 Establishing an Overlay for Rubber-banding
4.4.2 Normal Plane and Overlay Rendering
4.4.3 Spinning and Rubber-banding
4.4.4 Suspending Animation and Pop-up Menus
5 Exploring OpenGL with GLUT
5.1 Exploring Lighting with GLUT
5.1.1 The OpenGL Lighting Model
5.1.2 Using OpenGL's Lighting Model
Defining Light Sources
Defining the Surface Material
Other Lighting Concepts
5.1.3 Example: lightlab.c
5.2 Exploring OpenGL Texture Mapping with GLUT
5.2.1 Using Textures with OpenGL
Enabling Texturing
Specifying a Texture
Specifying Texture Modes
Rendering Textured Primitives
More Texturing Features
5.2.2 Fun with Textures
5.2.3 More on Texture Mapping
5.2.4 Example: mjkwarp.c
5.3 Exploring Blending Operations with GLUT
5.3.1 Uses for Blending
5.3.2 Antialiasing through Blending
5.3.3 Fog and Atmospheric Effects
5.3.4 Hints
5.3.5 Example: blender.c
5.4 Exploring Images and Bitmaps with GLUT
5.4.1 The Pixel Path
Unpacking and Converting Pixels
Converting, Scaling, Biasing, and Remapping Pixels
Positioning and Zooming the Image
Fragment Operations
5.4.2 Bitmaps
5.4.3 Reading and Copying Pixels
5.4.4 Texturing as the Merging of Geometry and Imagery
5.4.5 Example: splatlogo.c
5.5 Exploring Curves and Surfaces with GLUT
5.5.1 Why Curves and Surfaces?
5.5.2 Evaluators
5.5.3 The GLU NURBS Routines
5.5.4 More Information
5.5.5 Example: molehill.c
5.6 Exploring the OpenGL Extensions with GLUT
5.6.1 OpenGL Extension Naming
5.6.2 Available Extensions
5.6.3 Extension Interoperability
5.6.4 GLX Extensions
5.6.5 Extensions as OpenGL's Future
5.6.6 The Polygon Offset Extension
5.6.7 Example: origami.c
5.7 Exploring Open Inventor with GLUT
5.7.1 Procedural versus Descriptive
5.7.2 Open Inventor in Brief
5.7.3 Open Inventor with GLUT
5.7.4 Example: glutduck.c++
6 Advanced Topics
6.1 Revisions to OpenGL, GLX, and GLU
6.1.1 OpenGL 1.1
Vertex Arrays
Polygon Offset
RGBA Logical Operations
Internal Texture Image Formats
Texture Replace Environment
Texture Proxies
Copy Texture and Subtexture
Texture Objects
Miscellaneous Changes
6.1.2 GLX 1.1 and GLX 1.2
Vendor-specific GLX Extensions
GLX Implementation Information
Retrieving the Current Display
Minor GLX Updates
6.1.3 GLU 1.1 and GLU 1.2
GLU Implementation Information
Improved NURBS Support
Updated Polygon Tessellator
6.2 X Input Extension
6.2.1 Querying the Extension
6.2.2 Types of Extension Devices
Input Classes
6.2.3 Querying Supported Devices
xdevices.c
6.2.4 Sample Devices
SGI Dial and Button Box
SGI Spaceball
SGI Tablet
6.2.5 Opening and Selecting Events from a Device
6.2.6 Other X Input Extension Features
6.2.7 An Xlib-based OpenGL Example
6.2.8 X Toolkit Support for Extension Events
6.2.9 Motif-based OpenGL Examples
new_xt_tablet.c
old_xt_tablet.c
6.3 Using Overlays
6.3.1 Utility of Overlays
Minimizing Screen Repaint Costs
Overlaid Transparency
A Single Window Hierarchy
6.3.2 The Server Overlay Visuals Convention
6.3.3 An SOV Programming Interface
sovLayerUtil.h
sovlayerutil.c
6.3.4 Listing Overlay Visuals: sovinfo.c
6.3.5 An Xlib-only Overlay Example
layerdemo.c
6.3.6 Vendor Support for Overlays
6.3.7 Usage Considerations
Shallower Depths
Overlay Colormaps
Window Manager Interactions
6.3.8 Using Overlays with Motif Menus
6.4 Portability and Interoperability
6.4.1 Portability Issues
6.4.2 Interoperability Issues
Differences of Implementation Capacity and Quality
Differences of Implementation Capability
6.5 Hardware for Accelerating OpenGL
6.5.1 The Graphics Pipeline
6.5.2 A Taxonomy for Graphics Hardware
6.5.3 Rendering Paths
6.5.4 Hardware for OpenGL Stages
6.5.5 Display Options
Pixel Formats
Double Buffering
Overlays
Multiple Colormaps
Per-window Stereo
6.5.6 Rasterization
Primitive Decomposition
Texturing and Fog
Per-fragment Operations
6.5.7 Transforming Geometry
Pipelining and Parallelism
Types of Parallelism
6.5.8 Hardware for Window System Requirements
Graphics Context Switching
Fast and Arbitrary Window Clipping
Hardware Cursors
6.5.9 Graphics Subsystem Bottlenecks
Host vs. Transform vs. Fill Limits
OpenGL Command Bandwidth
6.6 Maximizing OpenGL Performance
6.6.1 Pipeline-based Tuning
The Problem of Graphics Bottlenecks
Dealing with Bottlenecks
6.6.2 Reducing OpenGL Command Overhead
Display Lists
Vertex Arrays
Evaluators
Send Less Per-vertex Data
Use Connected Primitives
6.6.3 Minimize OpenGL Mode Changes
6.6.4 Improving Transformation Performance
Optimizing Lighting
Reducing Polygon Counts
6.6.5 Improving Rasterization Performance
The Relative Expensive of Per-fragment Operations
Depth Buffer Tuning
Use Back Face Culling
Efficient Clears
6.6.6 Improving Imaging Performance
Getting Fastest Image Performance
6.6.7 Improving Texturing Performance
6.6.8 Constructing Application-specific Benchmarks
Using the GLUT-based Benchmark Harness
The GLUT Benchmark Harness
6.6.9 Beware of Standard Benchmarks
7 An Example Application
7.1 Running molview
7.2 The Molecule Data Structure: molview.h
7.3 Data File Reader: mol_file.c
7.4 Virtual Trackball: trackball.c
7.5 Molecule Renderer: render.c
7.6 Picking: pick.c
7.7 User Interface Initialization: gui_init.c
7.8 User Interface Operation: gui_run.c
A Obtaining GLUT, Mesa, and the Book's OpenGL Example Code
A.1 GLUT and the Book's Example Code
A.2 Obtaining Mesa
B Functional Description of the GLUT API
B.1 Initialization
B.2 Beginning Event Processing
B.3 Window Management
B.4 Overlay Management
B.5 Menu Management
B.6 Callback Registration
B.7 Color Index Colormap Management
B.8 State Retrieval
B.9 Font Rendering
B.10 Geometric Object Rendering
C GLUT State
C.1 Types of State
C.2 Global State
C.2.1 Program Controlled State
C.2.2 Fixed System Dependent State
C.3 Window State
C.3.1 Basic State
C.3.2 Frame Buffer Capability State
C.3.3 Layer State
C.4 Menu State
Glossary
Bibliography
Index
"Programming OpenGL for the X Window
System" Errata
The Xlib, Motif,
and GLUT source code from the book's examples
Addison-Wesley Developers
Press
Addison-Wesley
"Programming OpenGL for the X Window System" info
OpenGL
Center
Getting the
GLUT 3.6 software distribution
The OpenGL Web Site