FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Discussion
   General Processing Discussion
(Moderators: fry, REAS)
   structure of void loop();
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: structure of void loop();  (Read 2373 times)
minh


structure of void loop();
« on: Mar 27th, 2005, 1:12am »

is void loop() a Thread?
and is Thread or Runnable implicitly extended to BApplet? (so i don't have to extend Thread or Runnable, it's one of those )
 
curious.
 
fry


WWW
Re: structure of void loop();
« Reply #1 on: Mar 27th, 2005, 6:54am »

yeah, loop() is running on a thread. the idea of having loop() is so to avoid people having to learn how to write a thread before they can animate anything.
 
minh


Re: structure of void loop();
« Reply #2 on: Mar 27th, 2005, 11:06pm »

and also,
so the loop() function is inside a paint() or paintComponent() right?
 
thanks
 
fry


WWW
Re: structure of void loop();
« Reply #3 on: Mar 28th, 2005, 1:10am »

on Mar 27th, 2005, 11:06pm, minh wrote:
and also,
so the loop() function is inside a paint() or paintComponent() right

functionally yes, but technically no.
 
paintComponent() is called on the awt thread, loop() is called on the thread we were just discussing. so loop() takes care of handling the drawing, and then asks for a repaint. the awt thread then gets around to calling paint/paintComponent, at which time a single Image for the entire applet area is drawn to the screen.
 
Pages: 1 

« Previous topic | Next topic »