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 › background() in setup() problems
Page Index Toggle Pages: 1
background() in setup() problems (Read 945 times)
background() in setup() problems
Apr 21st, 2006, 5:14pm
 
Hi,

I run Linux and I'm using processing-0114.  I'm having a problem when I use the background() command inside the setup() block with the OPENGL renderer and in NORMAL MODE, as opposed to PRESENT MODE where it works just fine.

This might not be a bug, it might rather be some misconfiguration of my card or something but I can't find the problem.

Here's a sample code:
Quote:


import processing.opengl.*;

void setup(){
 size(200,200,OPENGL);
 background(255);
}

void draw(){
 translate(width/2, height/2);
}




This results in a black window.
Re: background() in setup() problems
Reply #1 - Apr 21st, 2006, 6:20pm
 
i wonder if it's related to this feller:
http://dev.processing.org/bugs/show_bug.cgi?id=282

also try setting the framerate in case it's a weird thread sync issue that things are starving out. unfortunately i haven't been able to replicate this stuff on my linux machine yet and have been too swamped to check into it further.
Re: background() in setup() problems
Reply #2 - Apr 21st, 2006, 7:25pm
 
You might be right, it must have something to do with sync.

Because when I run the following code several succesive times I will get most of the time a green screen (what's drawn in the setup()), but some of the times I get a black screen with a diagonal red line (what's drawn in the draw()).  All this without changing the sketch.

Quote:


import processing.opengl.*;

void setup(){
 size(200,200,OPENGL);
 framerate(30);

 background(255);

 fill(0,225,0);
 noStroke();
 rect(0,0,width,height);
}

void draw(){
 translate(width/2, height/2);
 stroke(255,0,0);
 line(-width/2, -height/2, width/2, height/2);
}


Re: background() in setup() problems
Reply #3 - May 12th, 2006, 5:58pm
 
k, i'm pretty sure this is tied to bug #282, so i'm gonna close this thread and we can follow up there.
Page Index Toggle Pages: 1