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 › PGraphics question
Page Index Toggle Pages: 1
PGraphics question (Read 1282 times)
PGraphics question
Apr 28th, 2005, 6:41pm
 
When I run this code, all I get is a white background, no shapes. Could someone point out what I am missing here. Obviously the buf.background(color val) is working, but no love for the shapes.

I've tried playing with null/this in the PGraphics constructor and the loadPixels/updatePixels although I believe that's only necessary for OpenGL.

Code:
PGraphics buf;
void setup(){
size(400,400,P3D);
// buf= new PGraphics(400, 400, null); // no diff
buf= new PGraphics(400, 400, this); // no diff

// buf.loadPixels(); // no effect
// loadPixels(); // no effect

buf.colorMode(RGB,255);
buf.background(255);
buf.fill(0,222,0);
buf.stroke(100,100,0);
buf.rect(10,20,100,100);
buf.ellipse(40,80,120,130);

// buf.updatePixels(); // no effect
// updatePixels(); // no effect

image(buf,0,0,width,height);

}

void draw(){
image(buf,0,0,width,height);
}
Re: PGraphics question
Reply #1 - Apr 28th, 2005, 7:09pm
 
You need to create a PGraphics3 instead.

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Syntax;action=display;num=1113919619

http://processing.org/faq/changes.html
Re: PGraphics question
Reply #2 - Apr 28th, 2005, 7:10pm
 
RTFF indeed. my mistake.
Re: PGraphics question
Reply #3 - Apr 28th, 2005, 10:13pm
 
After RTFF and the other thread I was a little confused. The faq and thread refer to PGraphics2, not PGraphics3. Either way, I tried using PGraphics3 and 2 and still no success.

I will assume that PGraphics is broken until the next release. Oh well, lots of other goodies to play with until then!

steve
Page Index Toggle Pages: 1