We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › bug with OPENGL / noLoop / saveFrame or loadPixels
Page Index Toggle Pages: 1
bug with OPENGL / noLoop / saveFrame or loadPixels (Read 263 times)
bug with OPENGL / noLoop / saveFrame or loadPixels
Feb 7th, 2009, 8:52pm
 
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");
}
}


Page Index Toggle Pages: 1