WGL: move wglGetCurrentContext

Roderick Colenbrander thunderbird2k at gmx.net
Sat Oct 14 05:56:07 CDT 2006


Hi,

This patch moves wglGetCurrentContext and removes it from winex11.drv. The function returns the context associated with the current thread. A context is made current using wglMakeCurrent. Inside wglMakeCurrent, the context is stored using 'NtCurrentTeb()->glContext = context'. I implemented wglGetCurrentContext inside gdi32 to look up this context and return it.

Right now some of the opengl code doesn't nicely store the context (after glxMakeCurrent) in the TEB. Since the old implementation of wglGetCurrentContext retrieved the active context from GLX and then looked up the associated WGL context, this didn't cause any troubles. Because the patch uses NtCurrentTeb() inside wglGetCurrentContext, the bad pieces of code had to store the context aswell.

Regards,
Roderick Colenbrander
-- 
GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wgl_context.patch
Type: text/x-patch
Size: 6652 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20061014/1189596a/wgl_context.bin


More information about the wine-patches mailing list