Bug 1052 : flickering and red-blue vertical mirroring when using updatePixels with OpenGL on OSX
Last modified: 2008-11-26 18:14




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
Tom K
Assigned To:
fry

Attachment Type Created Size Actions
image showing the mirroring image/png 2008-11-24 09:32 259.75 KB

Description:   Opened: 2008-11-24 09:31
tested on 135 and 157

NVIDIA GeForce 7600 GT (iMac)


<code>

import processing.opengl.*;

void
setup() {
size(512, 512,OPENGL);
loadPixels();
for(int j = 0 ; j < height; j++) for(int i =0; i < width; i++)
pixels[i+j*width] = int(random(100));

}

void
draw() {
if (mousePressed) {
pixels[mouseX+mouseY*width] = color(255,0,0);
}
updatePixels();
}


</code>
Additional Comment #1 From Tom K 2008-11-24 09:32
edit]
image showing the mirroring
Additional Comment #2 From fry 2008-11-24 10:40
loadPixels and updatePixels have to be used together. you can't call
loadPixels() once, and then keep calling updatePixels() inside draw()
repeatedly. you need loadPixels() at the top of draw(), and updatePixels()
at the end.
Additional Comment #3 From Tom K 2008-11-26 18:14
OK, thanks Ben.

I had lost the habit of doing so as calling loadPixels only once seems to
work quite nicely in the default rendering mode (and in P2D), with a slight
speed gain even.