opengl32: make the old code before the "sync the dibsection to its pixmap" patch be selectable at runtime

Lionel Ulmer lionel.ulmer at
Mon Mar 20 16:26:15 CST 2006

On Mon, Mar 20, 2006 at 05:37:50PM +0100, Leon Freitag wrote:
> Why thread-local variables? AFAIK OpenGL is single-threaded in its nature. I 
> don't know if there are applications that draw opengl in multiple threads in 
> different contents, and if current code would make any problems with these.

Well, in OpenGL each thread can have its own context (and you can also bind
a context to only one thread which explains why multi-threaded D3D
applications are such a pain to support). So you can have multi-threaded GL
applications with each thread having its own GL context.

So instead of retrieving the context on each ENTER_GL / LEAVE_GL macro using
the GLX call, one can simply store the currently bound context for the
current thread in a thread-local variable.

This is what Mike's patch does.


		 Lionel Ulmer -

More information about the wine-devel mailing list