mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
do not call handleDraw() after the sketch is finished
This commit is contained in:
@@ -874,18 +874,20 @@ public class PSurfaceJOGL implements PSurface {
|
||||
requestFocus();
|
||||
}
|
||||
|
||||
pgl.getGL(drawable);
|
||||
int pframeCount = sketch.frameCount;
|
||||
sketch.handleDraw();
|
||||
if (pframeCount == sketch.frameCount) {
|
||||
// This hack allows the FBO layer to be swapped normally even if
|
||||
// the sketch is no looping, otherwise background artifacts will occur.
|
||||
pgl.beginRender();
|
||||
pgl.endRender(sketch.sketchWindowColor());
|
||||
if (!sketch.finished) {
|
||||
pgl.getGL(drawable);
|
||||
int pframeCount = sketch.frameCount;
|
||||
sketch.handleDraw();
|
||||
if (pframeCount == sketch.frameCount || sketch.finished) {
|
||||
// This hack allows the FBO layer to be swapped normally even if
|
||||
// the sketch is no looping or finished because it does not call draw(),
|
||||
// otherwise background artifacts may occur (depending on the hardware/drivers).
|
||||
pgl.beginRender();
|
||||
pgl.endRender(sketch.sketchWindowColor());
|
||||
}
|
||||
PGraphicsOpenGL.completeFinishedPixelTransfers();
|
||||
}
|
||||
|
||||
PGraphicsOpenGL.completeFinishedPixelTransfers();
|
||||
|
||||
if (sketch.exitCalled()) {
|
||||
PGraphicsOpenGL.completeAllPixelTransfers();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user