title: Change background of GLFWwindow on key press
body: <p>I want to be able to cycle through 5 background colours when I press the "B" key. Right now I can only change my colour to red. I'm not sure if I'm going about this the right way. Any help would be appreciated. </p>
  
  <pre><code>static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {
  
  if (key == GLFW_KEY_B &amp;&amp; action == GLFW_PRESS)
  {
      for (int i = 0; i &lt; 5; i++)
      {
          switch (i)
          {
              case 0:
                  glClearColor(1.0, 0.0, 0.0, 1.0);
                  break;
  
              case 1:
                  glClearColor(0.0, 1.0, 0.0, 1.0);
                  break;
  
              case 2:
                  glClearColor(0.41, 0.41, 0.41, 1.0);
                  break;
  
              case 3:
                  glClearColor(1.0, 1.0, 1.0, 1.0);
                  break;
  
              case 4:
                  glClearColor(0.0, 0.0, 1.0, 1.0);
                  return;
             }
         }
     }
  }
  </code></pre>