gluX - cross platform easy OpenGL eXtension Loading



FAQ


What are the interesting features of gluX ?

I tried to make gluX 'developer friendly': if an extension is not loaded it exits with a nice message instead of crashing because of a NULL pointer access. The perl script allows you to easily add extensions by updating the glext.h file. Another interest of gluX is its ability to make a difference between a required extension and an optional extension. Also, the query for checking if an extension is available is very fast (see documentation and GLUX_IS_AVAILABLE macro).
GluX tries to load an extension even if the driver report that the extension is not present. This is usually the case when an extension is in development.

How can I use a wgl extension ?

It is very simple: let's say you want to use the GL_NV_vertex_array_range extension. This extension is making use of plateform depedent functions wglAllocateMemoryNV and wglFreeMemoryNV to allocate / free memory. Therefore you also need to load the WGL_NV_vertex_array_range extension:
GLUX_REQUIRE(GL_NV_vertex_array_range);
GLUX_REQUIRE(WGL_NV_vertex_array_range);
And then you can call the functions wglAllocateMemoryNV and wglFreeMemoryNV.

Why do I have link problems when compiling a program with gluX under Windows ?

There is four versions of the gluX library for windows: Check that you are compiling with the correct version of the library. If you are using the SDL library (or any other multi-threaded library like qt-mt), you should link with the multi-thread version of gluX.

An OpenGL function is missing ! (exemple: glBlendColor)

gluX is created by parsing latest OpenGL header files. These headers are present in the glux\script directory. If you are using older headers (as it is often the case under Windows), some functions that used to be extensions but have since be included in OpenGL might be missed. glBlendColor is one of those. To fix this issue, simply include the OpenGL headers located in the script directory (they have to be renamed without the reg_ prefix: reg_glext.h => glext.h). Also, in the case of glBlendColor, another extension defines the function glBlendColorEXT . You can find the latest OpenGL extension headers on the SGI website.

Why do I have link problems when compiling sample programs under Linux ?

Sometimes configure reports gcc as the c++ compiler instead of g++. The result is that the exe file are not linked with the correct run-time library. To correct this simply edit the Makefile in the sample directory and change gcc to g++.

I have a compilation error when compiling gluX under Linux (typedef conflict, glXGetProcAddressARB not defined)

Please check that your header files (gl.h,glx.h and glxtokens.h ) are not from Mesa (the word Mesa will appear in the comment at the beginning of the file if it the case). gluX is unfortunately not compatible with Mesa header files ... If you have Mesa header files, please replace them by the OpenGL headers provided - for instance - by NVidia (/usr/share/doc/NVIDIA_GLX-1.0/include). Then launch configure again.

Do I need to compile gluX ?

If you are using gluX under Windows you can directly use the libraries provided in the binary package. Under Linux you have to compile gluX because your computer may have special defintions for extensions (see below).

The configure script says that glXGetProcAddressARB is not available on my computer ! (Linux)

If you are on a SGI workstation, there is no extension loading mechanism and therefore gluX will not compile (this may change in a future release ...)
If not, please make sure that you have standard OpenGL headers. This error usually comes from a non standard glx.h header file. You can force configure to ignore glXGetProcAddressARB by using the --with-glXGetProcAddressARB command line option. You can also specify which gl.h and glx.h should be used with gl_header= and glx_header= (see configure --help).

What is this glux_no_redefine.h file ?

Under some Linux systems, the gl.h file already includes some extension definitions (the available extensions do not need to be loaded). This file contains the definition of the functions that should not be loaded by gluX. Note that under Windows this file should be empty.

Why is gluX a shared library under Linux whereas it is a static library under Windows ?

As gluX under Linux depends on how the system is configured (see above), it has to be compiled for an individual computer. It is not the case under Windows. However if you compile gluX on a Linux computer with a standard OpenGL installation then you can safely use the library on other computers (and link it statically) = > I strongly recommand to keep a standard OpenGL installation on your computer if you are willing to distribute your programs. To compile gluX as a static library, execute configure, enter the src directory and type make static .

The perl scripts don't work (Linux) !?

The scripts are assuming that perl is in /usr/bin/perl. If not, modify the first line of the scripts with the correct path to the perl executable.

I am trying to compile under Windows but ... a lot of source files are missing !?

The most part of the gluX source code is generated by the perl script script/code_plugins.pl. The perl script must be called prior to compiling if the source files are not present. To manually create the source files, enter the script directory and execute perl code_plugins.pl reg_glext.h reg_wglext.h reg_glxext.h . Then copy all the generated cpp and h files from the script/src directory to the src directory. If new extensions are available, you have to add the new .cpp files to the Visual C++ project.

I am trying to compile under Windows, the perl script works fine, but I have an error message saying that the linker cannot open an obj file !?

The reason is that Visual.NET only tries to compile the files which exist when the compilation starts (and it checks for file existence before the pre-build step). As most source files are actually generated by the perl script, the compiler doesn't try to compile them. The solution is simple: launch compilation again and it will work the second time ...

For some obscure reason, an extension that I don't need refuse to compile ... what can I do ?

Due to the wide variety of Linux distributions, it is hard to predict every cases that may occur. Therefore, it is possible that an extension refuse to compile on your system. If you do not need this extension (or it is not present on your system) you can simply edit the Makefile and suppress the .cpp/.h files associated with the extension. Note that each time you launch configure the Makefile is generated again.

How can I add new extensions to gluX ?

Simply copy an updated glext.h, glxext.h or wglext.h file into the script directory and rename it to reg_glext.h, reg_glxext.h or reg_wglext.h. Enter the script directory and launch perl code_plugins.pl reg_glext.h reg_wglext.h reg_glxext.h. The source code is generated in script/src. Go back to the main directory and compile glux again using configure or the Visual C++ project files. If you are compiling for Windows, you have to add the files of the new extensions to the Windows project.

gluX gives me headaches ! What can I do ?

hmmm .... first take a breath, stay calm: beating the screen with the keyboard will not result in any good (I tried ;). You will find in the documentation some links to other extension loading libraries = > try another one :)
And when you feel better, do not forget to send me an email to explain what you didn't like in gluX.

Where can I report a bug ?

Please report bugs at Sylvain.Lefebvre@imag.fr (if you have a correction feel free to send it :))