wgl: Cleanup wglMakeCurrent.
This commit is contained in:
parent
9a2c4f7114
commit
900094cbfe
|
@ -1464,28 +1464,17 @@ BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) {
|
||||||
Wine_GLContext *ctx = (Wine_GLContext *) hglrc;
|
Wine_GLContext *ctx = (Wine_GLContext *) hglrc;
|
||||||
Drawable drawable = physDev->drawable;
|
Drawable drawable = physDev->drawable;
|
||||||
if (ctx->ctx == NULL) {
|
if (ctx->ctx == NULL) {
|
||||||
int draw_vis_id, ctx_vis_id;
|
/* The describe lines below are for debugging purposes only */
|
||||||
VisualID visualid = (VisualID)GetPropA( GetDesktopWindow(), "__wine_x11_visual_id" );
|
if (TRACE_ON(wgl)) {
|
||||||
TRACE(" Wine desktop VISUAL_ID is 0x%x\n", (unsigned int) visualid);
|
describeDrawable(ctx, drawable);
|
||||||
draw_vis_id = describeDrawable(ctx, drawable);
|
describeContext(ctx);
|
||||||
ctx_vis_id = describeContext(ctx);
|
}
|
||||||
|
|
||||||
if (-1 == draw_vis_id || (draw_vis_id == visualid && draw_vis_id != ctx_vis_id)) {
|
/* Create a GLX context using the same visual as chosen earlier in wglCreateContext.
|
||||||
/**
|
* We are certain that the drawable and context are compatible as we only allow compatible formats.
|
||||||
* Inherits from root window so reuse desktop visual
|
|
||||||
*/
|
*/
|
||||||
XVisualInfo template;
|
|
||||||
XVisualInfo *vis;
|
|
||||||
int num;
|
|
||||||
template.visualid = visualid;
|
|
||||||
vis = XGetVisualInfo(ctx->display, VisualIDMask, &template, &num);
|
|
||||||
|
|
||||||
TRACE(" Creating GLX Context\n");
|
|
||||||
ctx->ctx = pglXCreateContext(ctx->display, vis, NULL, type == OBJ_MEMDC ? False : True);
|
|
||||||
} else {
|
|
||||||
TRACE(" Creating GLX Context\n");
|
TRACE(" Creating GLX Context\n");
|
||||||
ctx->ctx = pglXCreateContext(ctx->display, ctx->vis, NULL, type == OBJ_MEMDC ? False : True);
|
ctx->ctx = pglXCreateContext(ctx->display, ctx->vis, NULL, type == OBJ_MEMDC ? False : True);
|
||||||
}
|
|
||||||
TRACE(" created a delayed OpenGL context (%p)\n", ctx->ctx);
|
TRACE(" created a delayed OpenGL context (%p)\n", ctx->ctx);
|
||||||
}
|
}
|
||||||
TRACE(" make current for dis %p, drawable %p, ctx %p\n", ctx->display, (void*) drawable, ctx->ctx);
|
TRACE(" make current for dis %p, drawable %p, ctx %p\n", ctx->display, (void*) drawable, ctx->ctx);
|
||||||
|
|
Loading…
Reference in New Issue