Subdirectory | This Directory Contains... |
---|---|
include/GL | Header files needed for OpenGL development. |
lib | Several run-time shared libraries. |
lbin | Run-time executables. |
doc | OpenGL documentation including reference pages. |
contrib/libwidget | A Motif widget library and source code. |
contrib/glut_samples | Example OpenGL programs that are referenced in the OpenGL Programming Guide. |
contrib/libglut | Utilities found in the OpenGL Utility Toolkit as mentioned in the OpenGL Programming for the X Window System manual. |
contrib/xglinfo | Utility to print display and visual information for OpenGL with the X Window system. |
contrib/glw_samples | Source code for Motif widget sample programs. |
#include <GL/gl.h>Still other header files may be needed by your program, depending on your application. For example, in order to use the OpenGL extension to X Windows (GLX) you must include glx.h, as shown below.
#include <GL/glx.h>Instructions for including various additional header files are usually provided with the README file that accompanies the utility or function. The README also includes instructions for using or operating the utilities.
Your header file declarations at the beginning of your program should look similar to this:
#include <sys/types.h> #include <stdio.h> #include <string.h> #include <X11/X.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <GL/gl.h> #include <GL/glx.h>
When you compile your OpenGL programs, you must link the application with the OpenGL library libGL. Notice that the OpenGL library is dependent on the HP X extensions library (libXext).
An ANSI C compile line will typically look similar to this:
c89 program.c -I/opt/graphics/OpenGL/include \ -L/opt/graphics/OpenGL/lib -lXext -lGL -lX11Note that to compile your application using ANSI C, you can also use the cc command with either of the command line options +Aa or +Ae.
If you are going to compile your application using HP's ANSI C++ compiler or cfront C++ compiler, use one of the following commands:
This table summarizes the shared libraries and X11 directories that are linked on the command line example above.
Library | Description |
---|---|
libGL | OpenGL routines |
libX11 | X11 routines |
libXext | HP X11 extensions |
If you get a large number of "Undefined pragma" messages (for example, Undefined pragma "HP_PLT_CALL" ignored) when compiling an OpenGL application, you are most likely using a compiler that does not support this new calling convention. To get an appropriate HP C or C++ compiler, you will need to contact your local HP Sales Representative.
You must also include the gl.h header file supplied with HP's implementation of OpenGL in any source code that makes OpenGL calls. If you have unresolved OpenGL symbols (for example, "Unsatisfied symbol glVertex3f") when linking your application, make sure that the correct gl.h file is being included in all your source files. Any gl.h files from other vendors or other sources will not work with HP's implementation of OpenGL.