I have a random question regarding the efficiency of programs. I am use to only programming with Delphi (which is very static compared to processing) so processing is something new to me. Here is a program I made (originally to represent QR codes):
The Salty_Tree_Sparrow
- //import processing.opengl.*;
int rad = 2;
int col;
int once = 0;
void setup(){
// size(800, 800, OPENGL);
size(800, 800);
smooth();
//hint(ENABLE_OPENGL_4X_SMOOTH);
background(255);
noStroke();
}
void grid(){
for (int k = 0; k < width / rad; k++){
for (int i = 0; i < height / rad; i++){
col = int(random(2) + 1);
if (col == 1){
fill(255);
}
else {
fill(0);
}
rect(k * rad, i * rad, rad, rad);
}
}
}
void draw(){
if (once < 1){
grid();
}
once++;
if (mousePressed){
once = 0;
}
println(frameRate);
}
The Salty_Tree_Sparrow
1