Can you explain why this is a requirement? This seems odd, since you want to access the pixels array of g ā and that is what loadPixels is for.
You can try to skip this sometimes, but are explicitly warned against it in the reference:
Certain renderers may or may not seem to require loadPixels() or updatePixels() . However, the rule is that any time you want to manipulate the pixels[] array, you must have previously called loadPixels() , and after changes have been made, call updatePixels() . Even if the renderer may not seem to use this function in the current Processing release, this will always be subject to change.
I didnāt look at the source, but it could be that Processing automatically calls beginDraw and endDraw for the default g PGraphics at the begining and end of draw(). Maybe that means you canāt draw g onto something else because endDraw hasnāt been called yet?
Knowing why you want to do this may help suggest an alternative
I donāt want to use loadPixels on the main graphics cause it can be really slow depending on itās size.
So what I do now is make a smaller graphics, then I draw g on that smaller graphics and load the pixels from that instead. I can only get this working in post which is not safe to draw, but it worksā¦
Here is the repository if anyone is interested. If you made something cool then please post a image.
I will check later, if it doesnāt I can probably make it work.
That will make it also more friendly for PDE users that donāt have additional IDEās installed.
O yeah the thing is Max / Linux only, this has to do that I put the terminal in character mode. And Iām tired of making things cross platform.
Not sure if they started yet, and if they will, not sure if they will follow specification to make a descent terminal (supporting ANSI escapes, single character mode etc.)