diff options
Diffstat (limited to 'src/net/java')
-rw-r--r-- | src/net/java/games/gluegen/opengl/GLEmitter.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/net/java/games/gluegen/opengl/GLEmitter.java b/src/net/java/games/gluegen/opengl/GLEmitter.java index 5fb032124..0e64931ba 100644 --- a/src/net/java/games/gluegen/opengl/GLEmitter.java +++ b/src/net/java/games/gluegen/opengl/GLEmitter.java @@ -336,7 +336,9 @@ public class GLEmitter extends JavaEmitter private String tableClassPackage; private String tableClassName = "ProcAddressTable"; private Set/*<String>*/ skipProcAddressGen = new HashSet(); - private String getProcAddressTableExpr = "context.getGLProcAddressTable()"; + private String contextVariableName = "context"; + private String defaultGetProcAddressTableExpr = ".getGLProcAddressTable()"; + private String getProcAddressTableExpr; protected void dispatch(String cmd, StringTokenizer tok, File file, String filename, int lineNo) throws IOException { if (cmd.equalsIgnoreCase("EmitProcAddressTable")) @@ -357,6 +359,10 @@ public class GLEmitter extends JavaEmitter String sym = readString("SkipProcAddressGen", tok, filename, lineNo); skipProcAddressGen.add(sym); } + else if (cmd.equalsIgnoreCase("ContextVariableName")) + { + contextVariableName = readString("ContextVariableName", tok, filename, lineNo); + } else if (cmd.equalsIgnoreCase("GetProcAddressTableExpr")) { getProcAddressTableExpr = readGetProcAddressTableExpr(tok, filename, lineNo); @@ -381,7 +387,13 @@ public class GLEmitter extends JavaEmitter public String tableClassPackage() { return tableClassPackage; } public String tableClassName() { return tableClassName; } public boolean skipProcAddressGen (String name) { return skipProcAddressGen.contains(name); } - public String getProcAddressTableExpr() { return getProcAddressTableExpr; } + public String contextVariableName() { return contextVariableName; } + public String getProcAddressTableExpr() { + if (getProcAddressTableExpr == null) { + getProcAddressTableExpr = contextVariableName + defaultGetProcAddressTableExpr; + } + return getProcAddressTableExpr; + } } // end class GLConfiguration } |