aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/gluegen/cgram
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2004-10-04 22:55:39 +0000
committerKenneth Russel <[email protected]>2004-10-04 22:55:39 +0000
commit4b93bb531605fa082bdad6452d3e6a51cbb15bed (patch)
treec1de89e45cb309b82af89f90a06f263c305f2fe0 /src/net/java/games/gluegen/cgram
parenta74c41bb00bb2fd0a6d2a5470332dbaa1e53958c (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/cgram')
-rw-r--r--src/net/java/games/gluegen/cgram/types/Type.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/net/java/games/gluegen/cgram/types/Type.java b/src/net/java/games/gluegen/cgram/types/Type.java
index 531393aa5..440a762e0 100644
--- a/src/net/java/games/gluegen/cgram/types/Type.java
+++ b/src/net/java/games/gluegen/cgram/types/Type.java
@@ -225,7 +225,8 @@ public abstract class Type {
}
/** Helper method for determining how many pointer indirections this
- type represents (i.e., "void **" returns 2). */
+ type represents (i.e., "void **" returns 2). Returns 0 if this
+ type is not a pointer type. */
public int pointerDepth() {
PointerType pt = asPointer();
if (pt == null) {
@@ -234,6 +235,17 @@ public abstract class Type {
return 1 + pt.getTargetType().pointerDepth();
}
+ /** Helper method for determining how many array dimentions this
+ type represents (i.e., "char[][]" returns 2). Returns 0 if this
+ type is not an array type. */
+ public int arrayDimension() {
+ ArrayType arrayType = asArray();
+ if (arrayType == null) {
+ return 0;
+ }
+ return 1 + arrayType.getElementType().arrayDimension();
+ }
+
/** Helper routine for list equality comparison */
static boolean listsEqual(List a, List b) {
return ((a == null && b == null) ||