How should I go about rendering to an offscreen image in P5 alpha?
this works nicely in p68...
Code:BGraphics buffer;
void setup() {
size(200, 200);
buffer=new BGraphics(180,180);
buffer.defaults();
buffer.background(255);
buffer.stroke(0);
}
void loop() {
buffer.line(mouseX-10, mouseY-10, pmouseX-10, pmouseY-10);
image(buffer,10,10,180,180);
}
...but I get no sign of life from this in p90...
Code:PGraphics buffer;
void setup() {
size(200, 200);
buffer=new PGraphics(180,180,this);
buffer.defaults();
buffer.background(255);
buffer.stroke(0);
}
void draw() {
buffer.line(mouseX-10, mouseY-10, pmouseX-10, pmouseY-10);
image(buffer,10,10,180,180);
}
p.s. I've tried sandwiching the buffer drawing operations with buffer.beginFrame() and buffer.endFrame()
p.p.s. Alternatively, is there a p5 friendly way of temporarily setting a clipping rectangle?
p.p.p.s. I feel like a newb all over again and I love it.