[Wine] Re: PWGL, some improvements
qwertymn
wineforum-user at winehq.org
Mon Nov 17 12:47:41 CST 2008
Sorry, this was the patch that made gametap work, rediffed against curretn git:
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index b4845ad..06c20ea 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1863,27 +1863,35 @@ BOOL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) {
if (!has_opengl()) return FALSE;
if (NULL != dest && dest->ctx != NULL) {
- ERR("Could not share display lists, context already created !\n");
- return FALSE;
- } else {
- if (org->ctx == NULL) {
- int indirect = (GetObjectType(org->hdc) == OBJ_MEMDC);
- wine_tsx11_lock();
- describeContext(org);
+ WARN("Destination context already created, destroying it\n");
+ pglXDestroyContext(gdi_display, dest->ctx);
+ dest->ctx = NULL;
+ }
+ if (org->ctx == NULL) {
+ int indirect = (GetObjectType(org->hdc) == OBJ_MEMDC);
+ wine_tsx11_lock();
+ describeContext(org);
+
+ if(org->vis)
+ org->ctx = pglXCreateContext(gdi_display, org->vis, NULL, !indirect);
+ else /* Create a GLX Context for a pbuffer */
+ org->ctx = pglXCreateNewContext(gdi_display, org->fmt->fbconfig, org->fmt->render_type, NULL, True);
+ wine_tsx11_unlock();
+ TRACE(" created a delayed OpenGL context (%p) for Wine context %p\n", org->ctx, org);
+ }
+ if (NULL != dest) {
+ int indirect = (GetObjectType(dest->hdc) == OBJ_MEMDC);
+ wine_tsx11_lock();
+ describeContext(dest);
+ /* Create the destination context with display lists shared */
+ if(dest->vis)
+ dest->ctx = pglXCreateContext(gdi_display, dest->vis, org->ctx, !indirect);
+ else /* Create a GLX Context for a pbuffer */
+ dest->ctx = pglXCreateNewContext(gdi_display, dest->fmt->fbconfig, dest->fmt->render_type, org->ctx, True);
+ wine_tsx11_unlock();
+ TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx);
+ return TRUE;
- org->ctx = create_glxcontext(gdi_display, org, NULL, !indirect);
- wine_tsx11_unlock();
- TRACE(" created a delayed OpenGL context (%p) for Wine context %p\n", org->ctx, org);
- }
- if (NULL != dest) {
- int indirect = (GetObjectType(dest->hdc) == OBJ_MEMDC);
- wine_tsx11_lock();
- describeContext(dest);
- dest->ctx = create_glxcontext(gdi_display, dest, org->ctx, !indirect);
- wine_tsx11_unlock();
- TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx);
- return TRUE;
- }
}
return FALSE;
}
[/code]
More information about the wine-users
mailing list