From f8fe770c3e32b8159476b2f02cd316288bae06b1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 27 Apr 2010 03:21:40 +0200 Subject: Fix GLProcAddressResolver regression: Loop through all names until found or n/a. Return 0 if not found, no Exception --- .../gluegen/runtime/opengl/GLProcAddressResolver.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/java/com/jogamp') diff --git a/src/java/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java b/src/java/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java index ebe4d2685..914e52792 100644 --- a/src/java/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java +++ b/src/java/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java @@ -39,23 +39,23 @@ import com.jogamp.gluegen.runtime.FunctionAddressResolver; */ public class GLProcAddressResolver implements FunctionAddressResolver { + public static final boolean DEBUG = false; public long resolve(String name, DynamicLookupHelper lookup) { + long newProcAddress = 0; int permutations = GLExtensionNames.getFuncNamePermutationNumber(name); - for (int i = 0; i < permutations; i++) { + for (int i = 0; 0 == newProcAddress && i < permutations; i++) { String funcName = GLExtensionNames.getFuncNamePermutation(name, i); try { - return lookup.dynamicLookupFunction(funcName); + newProcAddress = lookup.dynamicLookupFunction(funcName); } catch (Exception e) { -// if (DEBUG) { -// dout.println(e); -// e.printStackTrace(); -// } + if (DEBUG) { + e.printStackTrace(); + } } } - - throw new RuntimeException("unresolveable function name: "+name); + return newProcAddress; } } -- cgit v1.2.3