From 51e246743458b40ebed92ffaebf2f07483becb51 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Tue, 15 Jul 2003 15:25:43 +0000 Subject: Added ContextVariableName configuration option to GLEmitter because of namespace conflicts with some argument names on X11. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@33 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/net/java/games/gluegen/opengl/GLEmitter.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/net/java/games') 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/**/ 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 } -- cgit v1.2.3