From 0749b42efef3fd5c061b2a94ca7ab635daa555e4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 14 Nov 2008 07:04:59 +0000 Subject: Added function name aliasing for 'isFunctionAvailable' dyn lookup case git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1788 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/GLContextImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/classes') diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java index 20fc6916c..5314b10c3 100644 --- a/src/classes/com/sun/opengl/impl/GLContextImpl.java +++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java @@ -350,9 +350,18 @@ public abstract class GLContextImpl extends GLContext { } } catch (Exception e) {} } - // dynamic function lookup at last (not cached) + // dynamic function lookup at last incl name aliasing (not cached) GLDrawableFactoryImpl factoryImpl = (GLDrawableFactoryImpl)getGLDrawable().getFactory(); - if(0!=factoryImpl.dynamicLookupFunction(glFunctionName)) { + String tmpBase = com.sun.gluegen.runtime.opengl.GLExtensionNames.normalizeVEN(com.sun.gluegen.runtime.opengl.GLExtensionNames.normalizeARB(glFunctionName, true), true); + long addr = 0; + int variants = com.sun.gluegen.runtime.opengl.GLExtensionNames.getFuncNamePermutationNumber(tmpBase); + for(int i = 0; 0==addr && i < variants; i++) { + String tmp = com.sun.gluegen.runtime.opengl.GLExtensionNames.getFuncNamePermutation(tmpBase, i); + try { + addr = factoryImpl.dynamicLookupFunction(tmp); + } catch (Exception e) { } + } + if(0!=addr) { return true; } return false; -- cgit v1.2.3