opengl32: Store alternative function in wglGetProcAddress.

Sebastian Lackner sebastian at fds-team.de
Wed Dec 9 18:47:47 CST 2015


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---

Instead of looking up alternatives each time, store them in the function table.
(For RuneScape its not really critical, but since we touched this code already ... ^^).

 dlls/opengl32/wgl.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 88aa564..3b817a4 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -884,15 +884,15 @@ PROC WINAPI wglGetProcAddress( LPCSTR name )
                 { "glCopyTexSubImage3DEXT", "glCopyTexSubImage3D" },  /* needed by RuneScape */
             };
 
-            for (i = 0; i < sizeof(alternatives)/sizeof(alternatives[0]); i++)
+            WARN("Extension %s required for %s not supported\n", ext_ret->extension, name);
+            driver_func = NULL;
+
+            for (i = 0; i < sizeof(alternatives)/sizeof(alternatives[0]) && !driver_func; i++)
             {
                 if (strcmp( name, alternatives[i].name )) continue;
-                WARN("Extension %s required for %s not supported, trying %s\n",
-                    ext_ret->extension, name, alternatives[i].alt );
-                return wglGetProcAddress( alternatives[i].alt );
+                WARN("Trying alternative %s for %s\n", alternatives[i].alt, name );
+                driver_func = wglGetProcAddress( alternatives[i].alt );
             }
-            WARN("Extension %s required for %s not supported\n", ext_ret->extension, name);
-            return NULL;
         }
 
         if (driver_func == NULL)
-- 
2.6.2



More information about the wine-patches mailing list