Skip to content

Commit dfa233b

Browse files
committed
fix setModified() so that OpenGL updates properly (#1786)
1 parent 3c53cee commit dfa233b

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

core/src/processing/core/PGraphicsJava2D.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,10 @@ public void endDraw() {
359359
// // full copy of the pixels to the surface in this.updatePixels().
360360
// setModified();
361361
// super.updatePixels();
362-
setModified(); // marks pixels as modified so that the pixels will be updated
362+
363+
// Marks pixels as modified so that the pixels will be updated.
364+
// Also sets mx1/y1/x2/y2 so that OpenGL will pick it up.
365+
setModified();
363366
}
364367

365368

core/src/processing/core/PImage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,10 @@ public boolean isModified() { // ignore
416416

417417
public void setModified() { // ignore
418418
modified = true;
419+
mx1 = 0;
420+
my1 = 0;
421+
mx2 = width;
422+
my2 = height;
419423
}
420424

421425

core/todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ X .png data written when .jpg file specified with save/saveFrame()
99
X https://github.com/processing/processing/issues/1810
1010
X remove() broken in the List classes
1111
X https://github.com/processing/processing/issues/1826
12+
X Java2D surfaces not updating when used with OpenGL
13+
X https://github.com/processing/processing/issues/1786
1214

1315
andres
1416
A PImage not drawn after resize()/get() in P2D/P3D

0 commit comments

Comments
 (0)