fix setModified() so that OpenGL updates properly (#1786)

This commit is contained in:
Ben Fry
2013-06-02 14:09:55 -04:00
parent fefaaf4f62
commit 9d66db05d2
3 changed files with 10 additions and 1 deletions

View File

@@ -359,7 +359,10 @@ public class PGraphicsJava2D extends PGraphics /*PGraphics2D*/ {
// // full copy of the pixels to the surface in this.updatePixels().
// setModified();
// super.updatePixels();
setModified(); // marks pixels as modified so that the pixels will be updated
// Marks pixels as modified so that the pixels will be updated.
// Also sets mx1/y1/x2/y2 so that OpenGL will pick it up.
setModified();
}

View File

@@ -416,6 +416,10 @@ public class PImage implements PConstants, Cloneable {
public void setModified() { // ignore
modified = true;
mx1 = 0;
my1 = 0;
mx2 = width;
my2 = height;
}

View File

@@ -9,6 +9,8 @@ X .png data written when .jpg file specified with save/saveFrame()
X https://github.com/processing/processing/issues/1810
X remove() broken in the List classes
X https://github.com/processing/processing/issues/1826
X Java2D surfaces not updating when used with OpenGL
X https://github.com/processing/processing/issues/1786
andres
A PImage not drawn after resize()/get() in P2D/P3D