aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/java/games/gluegen/cgram/types/FunctionType.java5
-rw-r--r--src/net/java/games/gluegen/opengl/GLEmitter.java12
-rw-r--r--src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java6
3 files changed, 20 insertions, 3 deletions
diff --git a/src/net/java/games/gluegen/cgram/types/FunctionType.java b/src/net/java/games/gluegen/cgram/types/FunctionType.java
index f864b4d2c..d84c49833 100644
--- a/src/net/java/games/gluegen/cgram/types/FunctionType.java
+++ b/src/net/java/games/gluegen/cgram/types/FunctionType.java
@@ -94,6 +94,11 @@ public class FunctionType extends Type {
argumentNames.add(argumentName);
}
+ public void setArgumentName(int i, String name)
+ {
+ argumentNames.set(i,name);
+ }
+
public String toString() {
return toString(null);
}
diff --git a/src/net/java/games/gluegen/opengl/GLEmitter.java b/src/net/java/games/gluegen/opengl/GLEmitter.java
index f6e26fd3b..5fb032124 100644
--- a/src/net/java/games/gluegen/opengl/GLEmitter.java
+++ b/src/net/java/games/gluegen/opengl/GLEmitter.java
@@ -224,6 +224,18 @@ public class GLEmitter extends JavaEmitter
//System.err.println("WARNING (GL): *not* run-time linking: " + sym +
// "(" + funcPointerTypedefName + " undefined)");
}
+ else
+ {
+ FunctionType typedef = typedefDictionary.get(funcPointerTypedefName).asPointer().getTargetType().asFunction();
+ FunctionType fun = sym.getType();
+ int numarg = typedef.getNumArguments();
+ for ( int i =0; i < numarg; i++ )
+ {
+ if ( fun.getArgumentName(i) == null )
+ fun.setArgumentName(i,typedef.getArgumentName(i));
+ }
+ }
+
return shouldWrap;
}
diff --git a/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java b/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java
index c3b17f6cb..4fb50ea21 100644
--- a/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java
+++ b/src/net/java/games/gluegen/opengl/JavaGLPAWrapperEmitter.java
@@ -157,8 +157,8 @@ public class JavaGLPAWrapperEmitter extends JavaMethodBindingImplEmitter
String procAddressVariable =
GLEmitter.PROCADDRESS_VAR_PREFIX + wrappedBinding.getName();
- writer.println(" final long addr = " + getProcAddressTableExpr + "." + procAddressVariable + ";");
- writer.println(" if (addr == 0) {");
+ writer.println(" final long __addr_ = " + getProcAddressTableExpr + "." + procAddressVariable + ";");
+ writer.println(" if (__addr_ == 0) {");
writer.println(" throw new GLException(\"Method \\\"" + binding.getName() + "\\\" not available\");");
writer.println(" }");
}
@@ -168,7 +168,7 @@ public class JavaGLPAWrapperEmitter extends JavaMethodBindingImplEmitter
if (numEmitted > 0) {
writer.print(", ");
}
- writer.print("addr");
+ writer.print("__addr_");
return 1 + numEmitted;
}