title: Java LWJGL: When I call "GL11.glEnd" the polygon disappears?
body: <p>When I call "GL11.glEnd" the polygon disappears. If I leave that one line "GL11.glEnd" out, then it stays on the screen, but when I put it in, the polygon I was drawing disappears.</p>
  
  <pre><code>package package01;
  
  import org.lwjgl.opengl.GL11;
  
  public class Graph {
  
      ...
  
  
  void initGraph(){
      GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); 
      GL11.glClearDepth(1.0); 
      GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
      GL11.glOrtho(-500, 500, -281, 281, -1, 1);
      GL11.glColor3f(0.8f, 0.8f, 1.0f);
      GL11.glBegin(GL11.GL_POLYGON);
          GL11.glVertex3f(-60, 110, 0);   
          GL11.glVertex3f(60, 110, 0);
          GL11.glVertex3f(120, 0, 0);
          GL11.glVertex3f(60, -110, 0);
          GL11.glVertex3f(-60, -110, 0);
          GL11.glVertex3f(-120, 0, 0);
      GL11.glEnd();
      GL11.glFlush();
  }
  }
  </code></pre>
  
  <p>And here is the second class if it would help.</p>
  
  <pre><code>package package01;
  
  ...
  
  public class DisplayScreen {
  Graph g = new Graph();
  
  
  void start(){
      try {
          Display.setDisplayMode(new DisplayMode(1000,562));
          Display.create();
          GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
          GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
  
      } catch(LWJGLException e) {
          e.printStackTrace();
  
      }
      while(!Display.isCloseRequested()){
  
          Display.update();
          g.initGraph();
      }
      Display.destroy();
  }
  
  
  public static void main(String[] args){
  
      DisplayScreen ds = new DisplayScreen();
      ds.start();
  
      }
  }
  </code></pre>