Commit aa95df0d authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Check if 'GLX_ARB_get_proc_address' is supported before using

glXGetProcAddressARB.
parent 64852f4b
...@@ -624,6 +624,7 @@ static BOOL process_attach(void) ...@@ -624,6 +624,7 @@ static BOOL process_attach(void)
Window root = (Window)GetPropA( GetDesktopWindow(), "__wine_x11_whole_window" ); Window root = (Window)GetPropA( GetDesktopWindow(), "__wine_x11_whole_window" );
HMODULE mod = GetModuleHandleA( "x11drv.dll" ); HMODULE mod = GetModuleHandleA( "x11drv.dll" );
void *opengl_handle; void *opengl_handle;
const char *extensions = NULL;
if (!root || !mod) if (!root || !mod)
{ {
...@@ -665,14 +666,17 @@ static BOOL process_attach(void) ...@@ -665,14 +666,17 @@ static BOOL process_attach(void)
vis = XGetVisualInfo(default_display, VisualIDMask, &template, &num); vis = XGetVisualInfo(default_display, VisualIDMask, &template, &num);
if (vis != NULL) default_cx = glXCreateContext(default_display, vis, 0, GL_TRUE); if (vis != NULL) default_cx = glXCreateContext(default_display, vis, 0, GL_TRUE);
if (default_cx != NULL) glXMakeCurrent(default_display, root, default_cx); if (default_cx != NULL) glXMakeCurrent(default_display, root, default_cx);
extensions = glXQueryExtensionsString(default_display, DefaultScreen(default_display));
XFree(vis); XFree(vis);
LEAVE_GL(); LEAVE_GL();
if ((extensions != NULL) && (strstr(extensions, "GLX_ARB_get_proc_address"))) {
opengl_handle = wine_dlopen(SONAME_LIBGL, RTLD_NOW|RTLD_GLOBAL, NULL, 0); opengl_handle = wine_dlopen(SONAME_LIBGL, RTLD_NOW|RTLD_GLOBAL, NULL, 0);
if (opengl_handle != NULL) { if (opengl_handle != NULL) {
p_glXGetProcAddressARB = wine_dlsym(opengl_handle, "glXGetProcAddressARB", NULL, 0); p_glXGetProcAddressARB = wine_dlsym(opengl_handle, "glXGetProcAddressARB", NULL, 0);
wine_dlclose(opengl_handle, NULL, 0); wine_dlclose(opengl_handle, NULL, 0);
} }
}
if (default_cx == NULL) { if (default_cx == NULL) {
ERR("Could not create default context.\n"); ERR("Could not create default context.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment