diff options
Diffstat (limited to 'src/java/com/sun/gluegen')
-rw-r--r-- | src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java | 16 | ||||
-rw-r--r-- | src/java/com/sun/gluegen/runtime/opengl/GLExtensionNames.java | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java b/src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java index 52b9fde..13660b9 100644 --- a/src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java +++ b/src/java/com/sun/gluegen/opengl/BuildStaticGLInfo.java @@ -92,11 +92,11 @@ public class BuildStaticGLInfo { // Handles function pointer protected static Pattern funcPattern = - Pattern.compile("^(GLAPI|extern)?(\\s*)(\\w+)(\\*)?(\\s+)(GLAPIENTRY|APIENTRY|WINAPI)?(\\s*)([w]?gl\\w+)\\s?(\\(.*)"); + Pattern.compile("^(EGLAPI|GLAPI|extern)?(\\s*)(\\w+)(\\*)?(\\s+)(EGLAPIENTRY|GLAPIENTRY|APIENTRY|WINAPI)?(\\s*)([ew]?gl\\w+)\\s?(\\(.*)"); protected static Pattern associationPattern = - Pattern.compile("\\#ifndef ([W]?GL[X]?_[A-Za-z0-9_]+)"); + Pattern.compile("\\#ifndef ([EW]?GL[X]?_[A-Za-z0-9_]+)"); protected static Pattern definePattern = - Pattern.compile("\\#define ([W]?GL[X]?_[A-Za-z0-9_]+)\\s*([A-Za-z0-9_]+)"); + Pattern.compile("\\#define ([EW]?GL[X]?_[A-Za-z0-9_]+)\\s*([A-Za-z0-9_]+)"); // Maps function / #define names to the names of the extensions they're declared in protected Map declarationToExtensionMap = new HashMap(); // Maps extension names to Set of identifiers (both #defines and @@ -256,7 +256,15 @@ public class BuildStaticGLInfo output.println(" */"); output.println(" public static String getFunctionAssociation(String glFunctionName)"); output.println(" {"); - output.println(" return (String)funcToAssocMap.get(glFunctionName);"); + output.println(" String mappedName = null;"); + output.println(" int funcNamePermNum = com.sun.gluegen.runtime.opengl.GLExtensionNames.getFuncNamePermutationNumber(glFunctionName);"); + output.println(" for(int i = 0; null==mappedName && i < funcNamePermNum; i++) {"); + output.println(" String tmp = com.sun.gluegen.runtime.opengl.GLExtensionNames.getFuncNamePermutation(glFunctionName, i);"); + output.println(" try {"); + output.println(" mappedName = (String)funcToAssocMap.get(tmp);"); + output.println(" } catch (Exception e) { }"); + output.println(" }"); + output.println(" return mappedName;"); output.println(" }"); output.println(); diff --git a/src/java/com/sun/gluegen/runtime/opengl/GLExtensionNames.java b/src/java/com/sun/gluegen/runtime/opengl/GLExtensionNames.java index bd9ffaf..5182e9d 100644 --- a/src/java/com/sun/gluegen/runtime/opengl/GLExtensionNames.java +++ b/src/java/com/sun/gluegen/runtime/opengl/GLExtensionNames.java @@ -49,7 +49,7 @@ public class GLExtensionNames { // if exist as an ARB extension with the same value. // Pass-3 Emit - public static final String[] extensionsARB = { "ARB", "GL2", "OES", "OML" }; + public static final String[] extensionsARB = { "ARB", "GL2", "OES", "KHR", "OML" }; public static final String[] extensionsVEN = { "3DFX", "AMD", "APPLE", |