FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 732 : enclosing size() call in a try-catch causes processign to crash
Last modified: 2008-02-18 06:39
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
INVALID -
Pr
i
ority:
P2
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
Reporter:
onar3d
Assigned To:
fry
Attachment
Type
Created
Size
Actions
Description
: Opened: 2008-02-18 05:08
Using processing 0135, when I enclose any code that includes a size() call
in a try()-catch() clause, Processing crashes with the message "new
renderer". This happens no matter if I use OpenGL or P3D.
This is not something that causes any significant trouble, since I can
simply avoid enclosing the size() call in the try-catch clause and be done
with it. Still, this may interest you, since I can assume it is not normal
behavior.
I am on a WinXP SP2 PC.
Code example:
import processing.opengl.*;
void setup()
{
try
{
size(400, 300, OPENGL);
}
catch (Exception e)
{
println(e.getMessage());
}
}
void draw()
{
background(128);
pushMatrix();
fill(255,0,255);
translate(0.25f*width, 0.25f*height);
rotateY(map(mouseX, 0, width, 0, PI));
rotateX(map(mouseY, 0, height, 0, PI));
box(90);
popMatrix();
}
Additional Comment
#1 From fry 2008-02-18 06:39
that's intentional, because of the mechanism used to change the renderer
mid-setup, which throws an exception so that setup() re-runs itself.