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.
IndexSuggestions & BugsSoftware Bugs › Classes freezes graphics window
Page Index Toggle Pages: 1
Classes freezes graphics window ? (Read 1112 times)
Classes freezes graphics window ?
Apr 20th, 2005, 4:47pm
 
This is a strange one... It took me a while to figure out what it was and it applies to all graphic rendering modes. It seems that whenever there are classes involved, the graphic window freezes on my machine when being moved around. Not necessarily when moved out of screen bounds or hidden behind other windows. Just moved around.


This works:

Code:

void setup(){
 size(200,200);
 framerate(25);
}

void draw(){
 if(random(9)<1) {
   background(200);
   print(".");
 }
 rect(random(191),random(191),9,9);
}



..and so does this:

Code:

void setup(){
 size(200,200);
 framerate(25);
}

void draw(){
 if(random(9)<1) {
   background(200);
   print(".");
 }
 update(random(191),random(191));  
}

void update(float xp, float yp){
 rect(xp,yp,9,9);
}



But, this does not:

Code:

rekti rekt = new rekti();

void setup(){
 size(200,200);
 framerate(25);
}

void draw(){
 if(random(9)<1) {
   background(200);
   print(".");
 }
 rekt.update(random(191),random(191));  
}

class rekti{
 rekti(){
 }  
 void update(float xp, float yp){
   rect(xp,yp,9,9);
 }
}



..and strangely enough, neither does this:

Code:

// rekti rekt = new rekti();

void setup(){
 size(200,200);
 framerate(25);
}

void draw(){
 if(random(9)<1) {
   background(200);
   print(".");
 }
 // rekt.update(random(191),random(191));  
 rect(random(191),random(191),9,9);
}

/*
class rekti{
 rekti(){
 }  
 void update(float xp, float yp){
   rect(xp,yp,9,9);
 }
}
*/


..even though all class related lines are commented out. Passing a "this" to the class makes no difference.

The dots are happily printed, even though graphic rendering freezes. And the freezing happens only when the graphic window is moved. Minimizing makes no difference and neither does arranging other windows in front.
Re: Graphic window freezes
Reply #1 - Apr 20th, 2005, 4:55pm
 
Umm.. Just noticed that the freezing was a known bug. At first I thought it only applied to openGL windows so only checked that section in bug list..

Anyway. Dunno if you know about freezing problems possibly being related with classes, so I don't remove this thread for now.
Re: Classes freezes graphics window ?
Reply #2 - Jul 28th, 2005, 5:23am
 
i believe this one has been fixed in the interim since its original posting.
Page Index Toggle Pages: 1