OPENGL Line Rendering Error?
in
Core Library Questions
•
11 months ago
I've been looking for ways to speed up my Processing application, and after a few tests it looks like the size of the screen I'm using (1440x900) is what's slowing down everything. So I've been experimenting with using OPENGL and it runs like a dream, however there's one small issue when I draw lines - they never seem to disappear again. For example, running the program below will create a line that follows your mouse and slowly fades out, as expected. However, when you switch to OPENGL, the line never disappears. I've looked up the issue but have found nothing, so I'm assuming it's some error on my side where I'm expecting OPENGL to act like JAVA2D when it's not supposed to. Hopefully someone can tell me what my issue is, or if I just can't use lines/strokes in OPENGL, or if there's another way to improve rendering on a large screen? Also, if it matters, i'm using Processing 2.06b on a laptop running Mac OSX 10.7.5
void setup () {
// JAVA2D is noticably slower, but works as expected
size(displayWidth, displayHeight, JAVA2D);
//size(displayWidth, displayHeight, OPENGL);
background(color(255));
fill(color(0, 4));
strokeWeight(4);
stroke(170);
}
void draw () {
rect(0, 0, width, height);
//background(color(0, 4)); // Does not seem to work as expected in OPENGL mode
line(pmouseX, pmouseY, mouseX, mouseY);
println(frameRate);
}
1