Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/wined3d/context.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 41dbca24dbc..62be2c37291 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1970,7 +1970,7 @@ HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, { HGLRC ctx; unsigned int ctx_attrib_idx = 0; - GLint ctx_attribs[7], ctx_flags = 0; + GLint ctx_attribs[9], ctx_flags = 0;
if (context_debug_output_enabled(gl_info)) ctx_flags = WGL_CONTEXT_DEBUG_BIT_ARB; @@ -2001,10 +2001,19 @@ HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, ctx_attribs[ctx_attrib_idx++] = ctx_flags; ctx_attribs[ctx_attrib_idx] = 0; } - if (!(ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs))) - WARN("Failed to create a WGL context with wglCreateContextAttribsARB, last error %#x.\n", - GetLastError()); - } + if ((ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs))) + return ctx; + ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_PROFILE_MASK_ARB; + ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + ctx_attribs[ctx_attrib_idx] = 0; + if ((ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs))) + return ctx; + ctx_attribs[ctx_attrib_idx - 3] &= ~WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + if ((ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs))) + return ctx; + } + WARN("Failed to create a WGL context with wglCreateContextAttribsARB, last error %#x.\n", + GetLastError()); } return ctx; }