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 › Group Drawing Events Before Rendering
Page Index Toggle Pages: 1
Group Drawing Events Before Rendering (Read 409 times)
Group Drawing Events Before Rendering
Sep 6th, 2007, 4:23pm
 
I want to do a handful of drawing commands (images, rectangles, nothing fancy) without displaying them to the user, then render the changes all at once, all together. I know I saw this somewhere in Discourse--a way to do this without drawing into a separate graphics object--but after a bunch of searching I can't turn it up. Could someone please point me to it?
Re: Group Drawing Events Before Rendering
Reply #1 - Sep 6th, 2007, 5:06pm
 
That's the default mode of operation of Processing. When you enter the draw function, nothing is changed on screen until the draw function ends, so:
Code:
void draw()
{
background(0);
rect(20,20,50,50);
recto(40,40,30,30);
}


Doesn't first clear the screen, show the user, draw a rect, show the user, draw another rect, show to the user, what happens is an offscreen image is blanked, has 2 rects drawn to it, and then only when draw is finished is the result shown to the user.
Page Index Toggle Pages: 1