[PATCH] Move loading of opengl functions away from the start of the opengl32 test as it appears that on Windows the behavior of wglGetProcAddress appears to depend on the WGL context. The reason is that Windows in theory allows for multiple GL implementations and for that reason the context is important. This should get us some more useful opengl test results.

Roderick Colenbrander thunderbird2k at gmx.net
Mon Oct 13 14:10:23 CDT 2008


---
 dlls/opengl32/tests/opengl.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c
index b931999..8b5aa4a 100644
--- a/dlls/opengl32/tests/opengl.c
+++ b/dlls/opengl32/tests/opengl.c
@@ -541,14 +541,6 @@ START_TEST(opengl)
         0, 0, 0                /* layer masks */
     };
 
-    init_functions();
-    /* The lack of wglGetExtensionsStringARB in general means broken software rendering or the lack of decent OpenGL support, skip tests in such cases */
-    if (!pwglGetExtensionsStringARB)
-    {
-        skip("wglGetExtensionsStringARB is not available\n");
-        return;
-    }
-
     hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW,
                         10, 10, 200, 200, NULL, NULL, NULL, NULL);
     ok(hwnd != NULL, "err: %d\n", GetLastError());
@@ -585,6 +577,22 @@ START_TEST(opengl)
             trace("OpenGL driver version: %s\n", glGetString(GL_VERSION));
             trace("OpenGL vendor: %s\n", glGetString(GL_VENDOR));
         }
+        else
+        {
+            skip("Skipping OpenGL tests without a current context\n");
+            return;
+        }
+
+        /* Initialisation of WGL functions depends on an implicit WGL context. For this reason we can't load them before making
+         * any WGL call :( On Wine this would work but not on real Windows because there can be different implementations (software, ICD, MCD).
+         */
+        init_functions();
+        /* The lack of wglGetExtensionsStringARB in general means broken software rendering or the lack of decent OpenGL support, skip tests in such cases */
+        if (!pwglGetExtensionsStringARB)
+        {
+            skip("wglGetExtensionsStringARB is not available\n");
+            return;
+        }
 
         test_makecurrent(hdc);
         test_setpixelformat(hdc);
-- 
1.5.4.3


--========GMX149921223927940984254--



More information about the wine-patches mailing list