Commit 402d2777 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

wgl: Fix wglGetProcAddress bug.

parent 8da7b133
...@@ -223,6 +223,9 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { ...@@ -223,6 +223,9 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) {
TRACE("(%s)\n", lpszProc); TRACE("(%s)\n", lpszProc);
if(lpszProc == NULL);
return NULL;
/* First, look if it's not already defined in the 'standard' OpenGL functions */ /* First, look if it's not already defined in the 'standard' OpenGL functions */
if ((local_func = GetProcAddress(opengl32_handle, lpszProc)) != NULL) { if ((local_func = GetProcAddress(opengl32_handle, lpszProc)) != NULL) {
TRACE(" found function in 'standard' OpenGL functions (%p)\n", local_func); TRACE(" found function in 'standard' OpenGL functions (%p)\n", local_func);
...@@ -234,10 +237,14 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { ...@@ -234,10 +237,14 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) {
ext_ret = (const OpenGL_extension *) bsearch(&ext, extension_registry, ext_ret = (const OpenGL_extension *) bsearch(&ext, extension_registry,
extension_registry_size, sizeof(OpenGL_extension), compar); extension_registry_size, sizeof(OpenGL_extension), compar);
/* If nothing was found, we are looking for a WGL extension */ /* If nothing was found, we are looking for a WGL extension or an unknown GL extension. */
if (ext_ret == NULL) { if (ext_ret == NULL) {
/* If the function name starts with a w it is a WGL extension */
if(lpszProc[0] == 'w')
return wine_wgl.p_wglGetProcAddress(lpszProc);
/* We are dealing with an unknown GL extension. */
WARN("Extension '%s' not defined in opengl32.dll's function table!\n", lpszProc); WARN("Extension '%s' not defined in opengl32.dll's function table!\n", lpszProc);
return wine_wgl.p_wglGetProcAddress(lpszProc);
} else { /* We are looking for an OpenGL extension */ } else { /* We are looking for an OpenGL extension */
/* Check if the GL extension required by the function is available */ /* Check if the GL extension required by the function is available */
......
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