Bug 241 : setup() called twice with size(width, height, MODE)
Last modified: 2005-12-08 15:06




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
rick.giles
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2005-12-08 15:01
Processing 0097
Windows XP SP 2
Java 1.5.0_06

There are two calls to setup() when setup() calls size(width, height,
MODE), and MODE is P2D, P3D or OPENGL. Sample sketch:

void setup() {
println("setup");
size(400, 400, P2D);
}

outputs

setup
setup
Additional Comment #1 From fry 2005-12-08 15:06
that's by design. if the renderer is changing an exception is thrown so
that setup() doesn't complete because the renderer must be valid before
setup() can be run.

that's also one reason why size() must go first inside setup().