diff options
Diffstat (limited to 'src/jogl/classes')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java | 12 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java | 9 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java index 8dba6dfac..9fef381f4 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java @@ -158,12 +158,12 @@ public class RegionRenderer { public final boolean isInitialized() { return initialized; } - /** Copies the current viewport in given target and returns it for chaining. */ + /** Copies the current int[4] viewport in given target and returns it for chaining. */ public final int[/*4*/] getViewport(final int[/*4*/] target) { System.arraycopy(viewport, 0, target, 0, 4); return target; } - /** Borrows the current viewport w/o copying. */ + /** Borrows the current int[4] viewport w/o copying. */ public final int[/*4*/] getViewport() { return viewport; } @@ -279,13 +279,15 @@ public class RegionRenderer { /** * No PMVMatrix operation is performed here. */ - public final void reshapeNotify(final int width, final int height) { + public final void reshapeNotify(final int x, final int y, final int width, final int height) { + viewport[0] = x; + viewport[1] = y; viewport[2] = width; viewport[3] = height; } public final void reshapePerspective(final float angle, final int width, final int height, final float near, final float far) { - reshapeNotify(width, height); + reshapeNotify(0, 0, width, height); final float ratio = (float)width/(float)height; final PMVMatrix p = rs.getMatrix(); p.glMatrixMode(GLMatrixFunc.GL_PROJECTION); @@ -297,7 +299,7 @@ public class RegionRenderer { * Perspective orthogonal, method calls {@link #reshapeNotify(int, int, int, int)}. */ public final void reshapeOrtho(final int width, final int height, final float near, final float far) { - reshapeNotify(width, height); + reshapeNotify(0, 0, width, height); final PMVMatrix p = rs.getMatrix(); p.glMatrixMode(GLMatrixFunc.GL_PROJECTION); p.glLoadIdentity(); diff --git a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java index defb26e77..715b812c1 100644 --- a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java +++ b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java @@ -109,22 +109,25 @@ public class CDTriangulator2D implements Triangulator { int size = loop.computeLoopSize(); while(!loop.isSimplex()){ final Triangle tri; + final boolean delauny; if(numTries > size){ tri = loop.cut(false); + delauny = false; } else{ tri = loop.cut(true); + delauny = true; } numTries++; if(tri != null) { - numTries = 0; - size--; tri.setId(maxTriID++); sink.add(tri); if(DEBUG){ - System.err.println("CDTri.gen["+i+"].0: "+tri); + System.err.println("CDTri.gen["+i+"].0: delauny "+delauny+", tries "+numTries+", size "+size+", "+tri); } + numTries = 0; + size--; } if(numTries > size*2){ if(DEBUG){ |