Next: 2.1 Initialization Up: OpenGL and X Previous: 3 OpenGL's X Support

4 A Simple Example Using X

Appendix A contains the C source code for a simple OpenGL program. This example demonstrates what is involved when programming OpenGL with Xlib. The program creates a window and draws a 3D cube (missing two faces) and allows the user to rotate the cube around the X, Y, and Z axes using the mouse buttons.

Besides demonstrating how to properly establish an X window for OpenGL rendering, the example demonstrates the use of double buffering, display lists, and establishing the proper viewing parameters.



mjk@asd.sgi.com
Wed Oct 19 18:06:42 PDT 1994