From 9d66db05d2dfe39d2eb8ca36553b16b4fe5524a8 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 2 Jun 2013 14:09:55 -0400 Subject: [PATCH] fix setModified() so that OpenGL updates properly (#1786) --- core/src/processing/core/PGraphicsJava2D.java | 5 ++++- core/src/processing/core/PImage.java | 4 ++++ core/todo.txt | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/processing/core/PGraphicsJava2D.java b/core/src/processing/core/PGraphicsJava2D.java index 1c5d6dbce..e0095728a 100644 --- a/core/src/processing/core/PGraphicsJava2D.java +++ b/core/src/processing/core/PGraphicsJava2D.java @@ -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(); } diff --git a/core/src/processing/core/PImage.java b/core/src/processing/core/PImage.java index 383395f39..345629db5 100644 --- a/core/src/processing/core/PImage.java +++ b/core/src/processing/core/PImage.java @@ -416,6 +416,10 @@ public class PImage implements PConstants, Cloneable { public void setModified() { // ignore modified = true; + mx1 = 0; + my1 = 0; + mx2 = width; + my2 = height; } diff --git a/core/todo.txt b/core/todo.txt index 1bb721c3d..514523858 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -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