title: How do you translate this code from Processing to C++?
body: <p>I wrote this code in Processing (<a href="http://www.processing.org/" rel="nofollow noreferrer">www.processing.org</a>) and was wondering how would one implement it using C++?</p>
  
  <pre><code>int i = 0;
  
  void setup()
  {
  size(1000,1000);
  }
  
  void draw()
  {
  //  frameRate(120);
    PImage slice = get();
    set(0,20,slice);  
  
    if( i % 2 == 0 )  fill(128); else fill(0);
    i++;
    rect(0,0,width,20);
  }
  </code></pre>
  
  <p>As you can see this simply scrolls down rectangles of alternating colors as fast as possible. Can the C++ implementation be as short? OpenGL?</p>