We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I am trying to draw a rectangle in the window from a Thread.
void setup(){
size(100,100);
T thread = new T();
thread.start();
}
class T extends Thread{
void run(){
rect(10,10,10,10);
}
}
But this didn't work. I hobe someone can help me?
Thank you!
Answers
this is a bad idea. only the draw() thread should update the image.
https://Forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
What koogs said is correct. You should not draw from multiple threads. You can do some processing of data on another thread, but all drawing needs to be done from the animation thread.
Thank you for the anwseres. I solved the problem another way.
Thank you