Even for functions such as glGetStringi() which are in OpenGL 3.0, we
call get_core_proc_address() with gl_10x_version = 10 (seems to be a
larger problem in the dispatch code generation).  That means we try
GetProcAddress("OPENGL32.DLL") and fail.  Now, if GetProcAddress()
fails, try get_ext_proc_address() too.
---
 tests/util/piglit-dispatch-init.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-dispatch-init.c 
b/tests/util/piglit-dispatch-init.c
index 22318a3..456f75b 100644
--- a/tests/util/piglit-dispatch-init.c
+++ b/tests/util/piglit-dispatch-init.c
@@ -94,8 +94,16 @@ get_core_proc_address(const char *function_name, int 
gl_10x_version)
        if (gl_10x_version > 11) {
                return get_ext_proc_address(function_name);
        } else {
-               return (piglit_dispatch_function_ptr)
+               piglit_dispatch_function_ptr p;
+               /* Try GetProcAddress() first.
+                * If that fails, try wglGetProcAddress().
+                */
+               p = (piglit_dispatch_function_ptr)
                        GetProcAddress(LoadLibraryA("OPENGL32"), function_name);
+               if (!p)
+                       p = get_ext_proc_address(function_name);
+               return p;
+
        }
 }
 
-- 
1.7.10.4

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to