glcontext/wgl: try wglCreateContextAttribsARB even not gl3 core profile

https://bugzilla.gnome.org/show_bug.cgi?id=764018
This commit is contained in:
Wang Xin-yu (王昕宇) 2016-03-22 16:51:53 +08:00 committed by Matthew Waters
parent 8a67cd90b3
commit 6ed2ca373a

View file

@ -223,12 +223,23 @@ gst_gl_context_wgl_create_context (GstGLContext * context,
} }
if (!context_wgl->wgl_context) { if (!context_wgl->wgl_context) {
if (context_wgl->priv->wglCreateContextAttribsARB && external_gl_context) {
context_wgl->wgl_context =
context_wgl->priv->wglCreateContextAttribsARB (device,
external_gl_context, 0);
}
if (!context_wgl->wgl_context) {
context_wgl->wgl_context = wglCreateContext (device); context_wgl->wgl_context = wglCreateContext (device);
if (!context_wgl->wgl_context) { if (!context_wgl->wgl_context) {
g_set_error (error, GST_GL_CONTEXT_ERROR, g_set_error (error, GST_GL_CONTEXT_ERROR,
GST_GL_CONTEXT_ERROR_CREATE_CONTEXT, GST_GL_CONTEXT_ERROR_CREATE_CONTEXT,
"Failed to create WGL context 0x%x", (unsigned int) GetLastError ()); "Failed to create WGL context 0x%x",
(unsigned int) GetLastError ());
goto failure; goto failure;
} }
@ -241,6 +252,7 @@ gst_gl_context_wgl_create_context (GstGLContext * context,
goto failure; goto failure;
} }
} }
}
context_wgl->priv->context_api = GST_GL_API_OPENGL; context_wgl->priv->context_api = GST_GL_API_OPENGL;
} }