// 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"); } }