title: Cube only displays if I call glPopMatrix after glEnd (not the other way around)
body: <p>I am encountering a very weird issue in OpenGl. The following code produces a yellow cube as expected</p>
  
  <pre><code>glPushMatrix();
  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (GLfloat[]){ 1, 1, 0, 1 });
  glBegin(GL_LINE_LOOP);
  glutSolidCube(1);
  glPopMatrix();
  glEnd();
  </code></pre>
  
  <p>However when I put glpopMatrix() after glEnd(), I just get a black screen without a cube.</p>
  
  <pre><code>glPushMatrix();
  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, (GLfloat[]){ 1, 1, 0, 1 });
  glBegin(GL_LINE_LOOP);
  glutSolidCube(1);
  glEnd();
  glPopMatrix();
  </code></pre>
  
  <p>To me the second approach makes more sense, (push, begin, end then pop) and I really have no idea why it does not work. Any help is appreciated, thanks!</p>