diff --git a/java/libraries/opengl/src/processing/opengl/PGraphics2D.java b/java/libraries/opengl/src/processing/opengl/PGraphics2D.java index 758b1ad6f..437752769 100644 --- a/java/libraries/opengl/src/processing/opengl/PGraphics2D.java +++ b/java/libraries/opengl/src/processing/opengl/PGraphics2D.java @@ -27,7 +27,6 @@ public class PGraphics2D extends PGraphicsOpenGL { public PGraphics2D() { super(); -// hints[ENABLE_ACCURATE_2D] = true; hints[ENABLE_PERSPECTIVE_CORRECTED_LINES] = false; } diff --git a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java index 83dfd3e69..c53eb4fb7 100644 --- a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java +++ b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java @@ -2366,6 +2366,7 @@ public class PGraphicsOpenGL extends PGraphics { tessellator.setStrokeWeight(strokeWeight); tessellator.setStrokeCap(strokeCap); tessellator.setStrokeJoin(strokeJoin); + tessellator.setTexCache(texCache, textureImage0, textureImage); if (stroke && defaultEdges && edges == null) inGeo.addTrianglesEdges(); if (normalMode == NORMAL_MODE_AUTO) inGeo.calcTrianglesNormals(); @@ -2403,19 +2404,19 @@ public class PGraphicsOpenGL extends PGraphics { } } - if (hasPoints) { - flushPoints(); - if (raw != null) { - rawPoints(); - } - } - if (hasLines) { flushLines(); if (raw != null) { rawLines(); } } + + if (hasPoints) { + flushPoints(); + if (raw != null) { + rawPoints(); + } + } if (flushMode == FLUSH_WHEN_FULL && !hints[DISABLE_TRANSFORM_CACHE]) { popMatrix(); @@ -10556,15 +10557,19 @@ public class PGraphicsOpenGL extends PGraphics { } void setFirstTexIndex(int firstIndex, int firstCache) { - firstTexIndex = firstIndex; - firstTexCache = PApplet.max(0, firstCache); + if (texCache != null) { + firstTexIndex = firstIndex; + firstTexCache = PApplet.max(0, firstCache); + } } void setLastTexIndex(int lastIndex, int lastCache) { - if (prevTexImage != newTexImage || texCache.size == 0) { - texCache.addTexture(newTexImage, firstTexIndex, firstTexCache, lastIndex, lastCache); - } else { - texCache.setLastIndex(lastIndex, lastCache); + if (texCache != null) { + if (prevTexImage != newTexImage || texCache.size == 0) { + texCache.addTexture(newTexImage, firstTexIndex, firstTexCache, lastIndex, lastCache); + } else { + texCache.setLastIndex(lastIndex, lastCache); + } } } diff --git a/java/libraries/opengl/src/processing/opengl/PShapeOpenGL.java b/java/libraries/opengl/src/processing/opengl/PShapeOpenGL.java index fe37e185f..31b249c33 100644 --- a/java/libraries/opengl/src/processing/opengl/PShapeOpenGL.java +++ b/java/libraries/opengl/src/processing/opengl/PShapeOpenGL.java @@ -2539,7 +2539,8 @@ public class PShapeOpenGL extends PShape { tessellator.setStrokeColor(strokeColor); tessellator.setStrokeWeight(strokeWeight); tessellator.setStrokeCap(strokeCap); - tessellator.setStrokeJoin(strokeJoin); + tessellator.setStrokeJoin(strokeJoin); + tessellator.setTexCache(null, null, null); if (family == GEOMETRY) { // The tessellation maps are used to associate input @@ -4014,13 +4015,13 @@ public class PShapeOpenGL extends PShape { // Some error. Root should never be null. At least it should be this. return; } - - if (havePoints) { - renderPoints(g); + + if (haveFill) { + renderFill(g, texture); if (g.haveRaw()) { - rawPoints(g); - } - } + rawFill(g, texture); + } + } if (haveLines) { renderLines(g); @@ -4029,11 +4030,11 @@ public class PShapeOpenGL extends PShape { } } - if (haveFill) { - renderFill(g, texture); + if (havePoints) { + renderPoints(g); if (g.haveRaw()) { - rawFill(g, texture); - } + rawPoints(g); + } } }