Hi, I have a problem using GLGraphicSOffScreen.clear() method. I want to initialize the offscreen with a specific color first, and then I want to draw something. I tried to use the clear() method but nothing worked.
pseudo code is as follows :
When I run the code, glScr.clear(255) doesn't work. the area outside the region(outside the double for-loop) is not updated. Can you tell me how to use the clear() method?
pseudo code is as follows :
- GLGraphicsOffScreen glScr;
glScr.beginDraw();
glScr.clear(255);
glScr.loadPixels();
for ( int y = a ; y < b ; y ++) {
for ( int x = c ; x<d ; x++){
glScr.pixels[id] = color( 255 - (tex1.pixels[id] & 0xFF) );
}
}
glScr.updatePixels();
glScr.endDraw();
When I run the code, glScr.clear(255) doesn't work. the area outside the region(outside the double for-loop) is not updated. Can you tell me how to use the clear() method?
1