diff options
author | Kenneth Russel <[email protected]> | 2004-10-04 22:55:39 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2004-10-04 22:55:39 +0000 |
commit | 4b93bb531605fa082bdad6452d3e6a51cbb15bed (patch) | |
tree | c1de89e45cb309b82af89f90a06f263c305f2fe0 /src/net/java/games/gluegen/JavaMethodBindingImplEmitter.java | |
parent | a74c41bb00bb2fd0a6d2a5470332dbaa1e53958c (diff) |
Fixed Issue 71: glMultiDrawElements() is missing
Added support to GlueGen to handle pointer-to-pointer types for
primitive types, like void** and int**. These are exposed as arrays of
appropriately-typed direct java.nio Buffers for simplicity. Checks for
whether the buffers are direct are performed and null checks for the
individual Buffer objects are done as well. Fixed an existing bug in
the conversion of outgoing char** arguments in C to String[] in Java
where null checks were missing; this showed up as crashes in
glShaderSourceARB. Exposed glMultiDrawElements and several other
less-common entry points taking void** arguments.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@154 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/gluegen/JavaMethodBindingImplEmitter.java')
-rw-r--r-- | src/net/java/games/gluegen/JavaMethodBindingImplEmitter.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/net/java/games/gluegen/JavaMethodBindingImplEmitter.java b/src/net/java/games/gluegen/JavaMethodBindingImplEmitter.java index 78a4a6ced..2701bc2ec 100644 --- a/src/net/java/games/gluegen/JavaMethodBindingImplEmitter.java +++ b/src/net/java/games/gluegen/JavaMethodBindingImplEmitter.java @@ -102,10 +102,22 @@ public class JavaMethodBindingImplEmitter extends JavaMethodBindingEmitter writer.println(" throw new " + getRuntimeExceptionType() + "(\"Length of array \\\"" + binding.getArgumentName(i) + "\\\" was less than the required " + arrayType.getLength() + "\");"); } else { - if (binding.getJavaArgumentType(i).isNIOBuffer()) { + JavaType javaType = binding.getJavaArgumentType(i); + if (javaType.isNIOBuffer()) { writer.println(" if (!BufferFactory.isDirect(" + binding.getArgumentName(i) + "))"); writer.println(" throw new " + getRuntimeExceptionType() + "(\"Argument \\\"" + binding.getArgumentName(i) + "\\\" was not a direct buffer\");"); + } else if (javaType.isNIOBufferArray()) { + String argName = binding.getArgumentName(i); + // Check direct buffer properties of all buffers within + writer.println(" if (" + argName + " != null) {"); + writer.println(" for (int _ctr = 0; _ctr < " + argName + ".length; _ctr++) {"); + writer.println(" if (!BufferFactory.isDirect(" + argName + "[_ctr])) {"); + writer.println(" throw new " + getRuntimeExceptionType() + "(\"Element \" + _ctr + \" of argument \\\"" + + binding.getArgumentName(i) + "\\\" was not a direct buffer\");"); + writer.println(" }"); + writer.println(" }"); + writer.println(" }"); } } } |