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 & HelpPrograms › rendering to offscreen PGraphics
Page Index Toggle Pages: 1
rendering to offscreen PGraphics (Read 1034 times)
rendering to offscreen PGraphics
May 16th, 2005, 6:54pm
 
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.
Re: rendering to offscreen PGraphics
Reply #1 - May 16th, 2005, 7:19pm
 
see here:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1115087536;start=0

and a partial solution here:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Contribution_3DOpenGL;action=display;num=1115982971;start=18

F
Page Index Toggle Pages: 1