ok, I think you are right @REAS @alignedleft what do you think? pg.clear() without begin/endDraw() works with JAVA2D, but does not with P2D/P3D, shouldn't the reference be updated so the example works irrespective of the renderer?
@codeanticode Good catch. My first choice would be to make the behavior consistent across renderers, so we don't have to complicate the documentation. Assuming that's not possible, we could either:
address this difference between renderers explicitly in the description, and provide two separate examples, or
just modify the current example to use pg.clear() only within begin/endDraw()
clear() should definitely only be used between beginDraw() and endDraw(). I'm surprised it would work with Java2D, but it's likely that it won't in all (most?) cases.
Activity
codeanticode commented on Nov 11, 2015
You need to enclose any drawing call on a PGraphics surface between begin/endDraw(), i.e.:
clankill3r commented on Nov 11, 2015
In that case, is it wrong to use clear like this:
https://processing.org/reference/clear_.html
?
codeanticode commented on Nov 11, 2015
ok, I think you are right @REAS @alignedleft what do you think? pg.clear() without begin/endDraw() works with JAVA2D, but does not with P2D/P3D, shouldn't the reference be updated so the example works irrespective of the renderer?
scotthmurray commented on Nov 11, 2015
@codeanticode Good catch. My first choice would be to make the behavior consistent across renderers, so we don't have to complicate the documentation. Assuming that's not possible, we could either:
Do you have a preference?
REAS commented on Nov 13, 2015
I like your second option, @alignedleft in addition to starting that in the Reference. I'll open an issue, can I assign it to you?
scotthmurray commented on Nov 13, 2015
Yes, please! Thanks.
benfry commented on Nov 13, 2015
clear() should definitely only be used between beginDraw() and endDraw(). I'm surprised it would work with Java2D, but it's likely that it won't in all (most?) cases.
github-actions commented on Jun 16, 2021
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.