From 171bf658d82e7f507e7e425933fb5d5fb93d3c82 Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Thu, 24 Sep 2015 23:24:49 -0400 Subject: [PATCH] Add disable async saving hint --- core/src/processing/core/PConstants.java | 5 ++++- core/src/processing/core/PGraphics.java | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/processing/core/PConstants.java b/core/src/processing/core/PConstants.java index c7d6e8395..6792ec054 100644 --- a/core/src/processing/core/PConstants.java +++ b/core/src/processing/core/PConstants.java @@ -520,5 +520,8 @@ public interface PConstants { static final int DISABLE_KEY_REPEAT = 11; static final int ENABLE_KEY_REPEAT = -11; - static final int HINT_COUNT = 12; + static final int DISABLE_ASYNC_SAVEFRAME = 12; + static final int ENABLE_ASYNC_SAVEFRAME = -12; + + static final int HINT_COUNT = 13; } diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 6ed48dc90..16d617526 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -1126,6 +1126,11 @@ public class PGraphics extends PImage implements PConstants { * (including auto-repeated). Call hint(DISABLE_KEY_REPEAT) to get events * only when the key goes physically up or down. *

+ * hint(DISABLE_ASYNC_SAVEFRAME) - P2D/P3D only - save() and saveFrame() + * will not use separate threads for saving and will block until the image + * is written to the drive. This was the default behavior in 3.0b7 and before. + * To enable, call hint(ENABLE_ASYNC_SAVEFRAME). + *

* As of release 0149, unhint() has been removed in favor of adding * additional ENABLE/DISABLE constants to reset the default behavior. This * prevents the double negatives, and also reinforces which hints can be