title: drawing figures with opengl
body: <p>I have an array that contains 0's and 1's and based on the value of the array I want to draw a square and fill it with a color. I have the follow code below, but it only makes 1 square in the middle of the screen. I feel like there is something I need to do with <code>glVertex2f()</code> but I'm kind of stumped.</p>
  
  <p>The end result is something like this</p>
  
  <p><img src="https://i.stack.imgur.com/dzoUo.png" alt="enter image description here"></p>
  
  <p>but my code is just one square colored.</p>
  
  <pre><code>for (int i = 0; i &lt; Width; i++) {
    for (int j = 0; j &lt; Height; i++) {
      if (myArray[i][j] == 0) {
        glColor(1.1, 1.1, 1.1);
      } else {
        glColor(2.2, 2.2, 2.2);
      }
  
      glBegin(GL_QUADS);
        glVertex2f(-0.2, 0.2);
        glVertex2f(0.2, 0.2);
        glVertex2f(0.2, 0.2);
        glVertex2f(-0.2, 0.2);
      glEnd;
    }
  }
  </code></pre>