diff options
author | Kenneth Russel <[email protected]> | 2005-07-08 16:02:53 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-07-08 16:02:53 +0000 |
commit | c6d6bcbcaceaa229944f380437a28af3a84f1dcd (patch) | |
tree | 5415f8a6a956de81ffe7abd01451f99c76f23824 /src/net/java/games/gluegen/CMethodBindingEmitter.java | |
parent | 0fa2740c8c186b0908baa5b7629bef657fe38527 (diff) |
Fixed Windows port after changes to GlueGen to include array offsets.
Ported all demos to new API. Temporarily added back in GLU entry
points taking primitive arrays as the underlying APIs (in particular,
glTexImage2D) do not yet support non-direct Buffers. Changed C code
generation to only add in array offset if array is non-null. Fixed bug
in GLU tesselator demo's vertex callback.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@318 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/gluegen/CMethodBindingEmitter.java')
-rw-r--r-- | src/net/java/games/gluegen/CMethodBindingEmitter.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/net/java/games/gluegen/CMethodBindingEmitter.java b/src/net/java/games/gluegen/CMethodBindingEmitter.java index 0c41d3aa2..5cf2833d9 100644 --- a/src/net/java/games/gluegen/CMethodBindingEmitter.java +++ b/src/net/java/games/gluegen/CMethodBindingEmitter.java @@ -702,9 +702,19 @@ public class CMethodBindingEmitter extends FunctionEmitter } // end of data copy if (EMIT_NULL_CHECKS) { - writer.println(" }"); - } + writer.print(" }"); + if (needsDataCopy) { + writer.println(); + } else { + // Zero out array offset in the case of a null pointer + // being passed down to prevent construction of arbitrary + // pointers + writer.println(" else {"); + writer.println(" " + binding.getArgumentName(i) + "_offset = 0;"); + writer.println(" }"); + } + } } else if (javaArgType.isString()) { if (emittingPrimitiveArrayCritical) { continue; |