
		Qt OpenGL Extension - The QGL Classes

The Qt OpenGL Extension makes it easy to use OpenGL in Qt
applications.  It provides an OpenGL widget class that can be used
just like any other Qt widget, only that it opens an OpenGL display
buffer where you can use the OpenGL API to render the contents.

The Qt OpenGL Extension is implemented as a platform-independent
Qt/C++ wrapper around the platform-dependent GLX and WGL C APIs. The
provided functionality is very similar to Mark Kilgard's GLUT library,
but with much more non-OpenGL-specific GUI functionality: the whole Qt
API.


			     Installation

After successful installation of Qt itself, you can build the Qt
OpenGL Extension library by giving the command 'make' in the
qt/extensions/opengl/src directory. The resulting library will be
placed in the same directory as the main Qt library (i.e. qt/lib).

The building process requires an OpenGL library and OpenGL header
files to be already installed on your system.

Note about using Mesa: Mesa versions earlier than 3.1 would use the
name "MesaGL" and "MesaGLU" for the libraries, instead of "GL" and
"GLU". If you want to use a pre-3.1 version of Mesa, you must change
the Makefiles to use these library names instead. The easiest way to
do this edit the SYSCONF_LIBS_OPENGL line in the config file you are
using (qt/configs/*), changing "-lGL -lGLU" to "-lMesaGL -lMesaGLU";
then run "configure" again.


		    Using the Qt OpenGL Extension

The Qt OpenGL Extension documentation is provided together with the
standard Qt documentation, in the qt/doc directory. Select the OpenGL
link in the "Extensions" paragraph on the main index page (index.html).

A set of example programs is provided in the directories in
qt/extensions/opengl/examples. To build them, just give the command
'make' in that directory. It is recommended to study the examples
programs to learn how to use the Qt OpenGL Extension. Start with the
basic examples: 'box' and 'gear'. The other examples demonstrate
specific features.

Building your own programs that use the Qt OpenGL Extension is done
just like building other Qt programs, the only extra step needed is:
      * If you use tmake: Just add the 'opengl' keyword to the 'CONFIG' line.
      * Otherwise: Link with the libqgl.a (Unix) or qgl.lib (Windows) library.


		   Note About Version Compatibility

The Qt OpenGL Extension library (qgl) is always built as a static
library (qgl.a/lib), and not a dynamic library (qgl.so/dll), even if
Qt itself is installed with the dynamic mode. This is because the Qt
OpenGL API may in the future be changed in ways that are not binary
compatible with previous versions, so your applications should not
depend on a dynamically linked qgl library. Since the Qt OpenGL
Extension is a rather small library, the resulting increase in the
size of the executables is insignificant.


