title: Cocoa and OpenGL: fastest way to draw array of rectangles
body: <p><strong>Background:</strong>
  I'm building a screensaver in Cocoa where some C code is generating a 2d array of values (between 0 and 1) representing amplitudes. I then want to display this on screen as a grid with the color of the cells representing the values in the array. </p>
  
  <p>I started off using a loop with NSBezierPath which was too slow. Then I moved to Rect List which was faster, but still too slow. Now I am considering either nsbitmapimagerep or moving to OpenGL (which I believe will be quicker).</p>
  
  <p><strong>Question:</strong>
  My question therefore is, what is the best way using opengl in cocoa to draw a 2-d array of squares (typically 200x200) where the positions are fixed but the colors change (hopefully up to 30 times per second)?</p>
  
  <p><strong>Attempt so far:</strong> I guess I'm going to want to use glDrawArrays or something similar rather than looping glQUAD? Or maybe move to a Vertex Buffer Object (about which I am currently reading)?</p>