/* Builds a 2d checkerboard of red and green squares, with whatever number of pixels per square you want. */ /* Function to create an array of pixels, alternating green and red, with the given number of pixels per square. Returns the array. */ GLubyte* init_checkerboard(int pixels_per_square) { int i,j; int pps = pixels_per_square; int bytes = pps*pps*64*3; GLubyte* checkerboard = (GLubyte*) malloc(bytes); /* The following is a red&green checkerboard. It's done using a 1D array alternating colors. We change colors every pps. */ int count=0; for(i=0;i