Chapter 11. Wine and OpenGL

Table of Contents
11.1. What is needed to have OpenGL support in Wine
11.2. How to configure
11.3. How it all works
11.4. Known problems - shortcomings

Written by Lionel Ulmer , last modification : 2000/06/13

(Extracted from wine/documentation/opengl)

11.1. What is needed to have OpenGL support in Wine

Basically, if you have a Linux OpenGL ABI compliant libGL ( http://oss.sgi.com/projects/ogl-sample/ABI/) installed on your computer, you should everything that is needed.

To be more clear, I will detail one step after another what the configure script checks.

If, after Wine compiles, OpenGL support is not compiled in, you can always check config.log to see which of the following points failed.

11.1.1. Header files

The needed header files to build OpenGL support in Wine are :

gl.h:

the definition of all OpenGL core functions, types and enumerants

glx.h:

how OpenGL integrates in the X Window environment

glext.h:

the list of all registered OpenGL extensions

The latter file (glext.h) is, as of now, not necessary to build Wine. But as this file can be easily obtained from SGI ( http://oss.sgi.com/projects/ogl-sample/ABI/glext.h), and that all OpenGL should provide one, I decided to keep it here.

11.1.2. OpenGL library thread-safety

After that, the script checks if the OpenGL library relies or not on the pthread library to provide thread safety (most 'modern' OpenGL libraries do).

If the OpenGL library explicitely links in libpthread (you can check it with a ldd libGL.so), you need to force OpenGL support by starting configure with the --enable-opengl flag.

The reason to this is that Wine contains some hacks done by Ove to cohabit with pthread that are known to work well in most of the cases (glibc 2.1.x). On the other hand, we never got Wine to work with glibc 2.0.6. Thus, I deemed preferable to play it safe : by default, I suppose that the hack won't work and that it's the user's responsability to enable it.

Anyway, it should be pretty safe to build with --enable-opengl.

11.1.3. OpenGL library itself

To check for the presence of 'libGL' on the system, the script checks if it defines the glXCreateContext function. There should be no problem here.

11.1.4. glXGetProcAddressARB function

The core of Wine's OpenGL implementation (at least for all extensions) is the glXGetProcAddressARB function. Your OpenGL library needs to have this function defined for Wine to be able to support OpenGL.

If your library does not provide it, you are out of luck.

Note: this is not completely true as one could rewrite a glXGetProcAddressARB replacement using dlopen and friends, but well, telling people to upgrade is easier :-).