I just posted this to http://dev.processing.org/bugs/
but I thought others might be interested in this ...
After drawing a sketch using OPENGL
and then calling noLoop() ...
if you call saveFrame("frame.tif")
or even just loadPixels()
then Processing will crash with this error:
// Invalid memory access of location 00000000 eip=96cac314
I hope we can get this bug fixed soon,
since I presume lots of people will want to:
(1) draw in a loop
(2) stop the drawing loop
(3) save the image
-- djones
Code:
// bug_saveFrame_noLoop
//
// this program illustrates a Processing bug
// in the following situation:
// (1) using OPENGL
// (2) after calling "noLoop()"
// (3) call "saveFrame()" or "loadPixels()"
// this crashes the program with this error:
// Invalid memory access of location 00000000 eip=96cac314
import processing.opengl.*;
void setup() {
size(400,400,OPENGL);
println("To test this Processing/OPENGL bug, ...");
println("(1) press 'n' to call noLoop()");
println("(2) press 's' to call saveFrame()");
println("(3) press 'p' to call loadPixels()");
}
void draw() {
fill(random(0,255));
ellipse(random(0,width),random(0,height),8,8);
}
void keyPressed() {
if (key == 'n') {
println("noLoop()");
noLoop();
} else if (key == ' ') {
println("loop()");
loop();
} else if (key == 's') {
println("saveFrame()");
saveFrame("frame.tif");
println("saveFrame success");
} else if (key == 'p') {
println("loadPixels()");
loadPixels();
println("loadPixels success");
}
}