DOCUMENTATION

PREREQUISITES

This module assumes that libGL.so, libGLU.so and libglut.so (opengl32.dll and glu32.dll on Windows) are properly installed on your system.

If used with OpenGL::Image, use v1.03 or newer.

DESCRIPTION

Naming convention:

Virtually all of the OpenGL 1.0, and 1.1 functions are available, and most of 1.2. In general, the calling sequence is identical in Perl as in C.

Most functions that have no pointer arguments are called identically in Perl as in C, and the same name is used.

Functions that use array arguments and have been changed in "the obvious way" -- to take a variable number of arguments and/or to return an array -- have the the same names as their C counterparts, but with a _p suffix.

All functions that take pointers are available with their original calling syntax and a _c suffix. These are most useful when combined with the OpenGL::Array module, which lets you allocate C arrays from Perl.

A third variant, _s, exists for most pointer functions, and takes a string argument for each pointer. The underlying OpenGL function will be passed a pointer to that string.

glpOpenWindow() provides a shortcut to glpcOpenWindow(). Both these functions have a special (mis)feature to handle cases when one does not need double buffering: if no GLX_DOUBLEBUFFER is specified, and creation of a "visual" fails, the creation is retried with GLX_DOUBLEBUFFER specified (to make it easier to support implementation which do not have SINGLEBUFFER visuals - which is typical on Suns).

Since "finishing drawing" with and without GLX_DOUBLEBUFFER should be done in different ways, a convenience function glpFlush() is provided; it operates the same as glFlush() if no enable-GLX_DOUBLEBUFFER hack was need, otherwise it acts as glFlush() followed by glXSwapBuffers(). This function should be used only in the case no GLX_DOUBLEBUFFER attribute was given to glpOpenWindow().

Additionally, in absense of GLUT, glpSolidSphere() is aliased to glutSolidSphere(), to make writing simple portable backward-compatible scripts easier.

Compatibility with OpenGL 0.4:

The OpenGL 0.4 library, written by Stan Melax, contains more support for some SGI specific functions then 0.5, so you may wish to stay with 0.4 on an SGI system. For other machines, 0.5 should greatly improve compatibility (compiling where 0.4 wouldn't have).

Code-level compatibility with OpenGL 0.4 is available if you refer to OpenGL simply via use OpenGL;. If you request specific packages (such as use OpenGL qw(glfunctions glconstants glutfunctions);), you'll get 0.5 specific support.

EXPORTS

The following tags can be used to selectively import symbols into the main namespace.