aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/impl/tesselator
diff options
context:
space:
mode:
authorTravis Bryson <[email protected]>2005-06-24 20:28:37 +0000
committerTravis Bryson <[email protected]>2005-06-24 20:28:37 +0000
commit0969a98f2007d76e38f8819eedfead5b840f6364 (patch)
tree82aff6a7fb922f45fc7853e5c5442af0d978768f /src/net/java/games/jogl/impl/tesselator
parented85f53f73d69a44c6b98b3824354be3fbb7bf58 (diff)
This putback adds array offsets to the public JOGL API. The offsets are
respected and used properly in all of the public and private functions. The changes are in gluegen, so that the code is generated properly. And also throughout the parts of the jogl code that are not gluegen-generated. For the internally generated implementation methods, a "1" is added to the method names. So as to not overload the public API. This is similar to what is already done with Buffer APIs, which have a "0" added internally. I used a "1" instead of a "0" to avoid any collisions of the signatures, which could happen if a null object was sent down for the Array (e.g., the wrong method would get called). This should be a suitable foundation for the implementation to add the ability to wrap arrays in Buffers, which we plan to add to the implementation soon. These changes will cause all existing JOGL programs to break, although adapting them is pretty easy. We will later be putting back changed examples and utilities that incorporate these new APIs. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@313 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/impl/tesselator')
-rw-r--r--src/net/java/games/jogl/impl/tesselator/GLUtesselatorImpl.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/net/java/games/jogl/impl/tesselator/GLUtesselatorImpl.java b/src/net/java/games/jogl/impl/tesselator/GLUtesselatorImpl.java
index 90de5bcc9..34638ba51 100644
--- a/src/net/java/games/jogl/impl/tesselator/GLUtesselatorImpl.java
+++ b/src/net/java/games/jogl/impl/tesselator/GLUtesselatorImpl.java
@@ -231,12 +231,12 @@ public class GLUtesselatorImpl implements GLUtesselator {
}
/* Returns tessellator property */
- public void gluGetTessProperty(int which, double[] value) {
+ public void gluGetTessProperty(int which, double[] value, int value_offset) {
switch (which) {
case GLU.GLU_TESS_TOLERANCE:
/* tolerance should be in range [0..1] */
assert (0.0 <= relTolerance && relTolerance <= 1.0);
- value[0] = relTolerance;
+ value[value_offset] = relTolerance;
break;
case GLU.GLU_TESS_WINDING_RULE:
assert (windingRule == GLU.GLU_TESS_WINDING_ODD ||
@@ -244,14 +244,14 @@ public class GLUtesselatorImpl implements GLUtesselator {
windingRule == GLU.GLU_TESS_WINDING_POSITIVE ||
windingRule == GLU.GLU_TESS_WINDING_NEGATIVE ||
windingRule == GLU.GLU_TESS_WINDING_ABS_GEQ_TWO);
- value[0] = windingRule;
+ value[value_offset] = windingRule;
break;
case GLU.GLU_TESS_BOUNDARY_ONLY:
assert (boundaryOnly == true || boundaryOnly == false);
- value[0] = boundaryOnly ? 1 : 0;
+ value[value_offset] = boundaryOnly ? 1 : 0;
break;
default:
- value[0] = 0.0;
+ value[value_offset] = 0.0;
callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
break;
}
@@ -386,7 +386,7 @@ public class GLUtesselatorImpl implements GLUtesselator {
return true;
}
- public void gluTessVertex(double[] coords, Object vertexData) {
+ public void gluTessVertex(double[] coords, int coords_offset, Object vertexData) {
int i;
boolean tooLarge = false;
double x;
@@ -402,7 +402,7 @@ public class GLUtesselatorImpl implements GLUtesselator {
lastEdge = null;
}
for (i = 0; i < 3; ++i) {
- x = coords[i];
+ x = coords[i+coords_offset];
if (x < -GLU.GLU_TESS_MAX_COORD) {
x = -GLU.GLU_TESS_MAX_COORD;
tooLarge = true;