title: Display ContextAttribs and GL11 Projection Matrix Mode - Function is not supported
body: <p>I am getting an error when I try to set the Matrix mode of my LWJGL program to GL_Projection.</p>
  
  <pre><code>glMatrixMode(GL_PROJECTION);
  </code></pre>
  
  <p>The error is : </p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalStateException: Function is not supported
            at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:58)
            at org.lwjgl.opengl.GL11.glMatrixMode(GL11.java:2075)
            ....</p>
  </blockquote>
  
  <p>I have tracked down the error to when I make my Display. When I remove my ContexAttribs my code doesn't display the error and renders! ( when I comment out the code that needs the contexattribs )</p>
  
  <p>This is my code:</p>
  
  <p>display code:</p>
  
  <pre><code>Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
  ContextAttribs attribs = new ContextAttribs(3, 2).withProfileCore(true).withForwardCompatible(true);
  Display.create(new PixelFormat().withDepthBits(24).withSamples(4), attribs);
  Display.setTitle(TITLE);
  Display.setInitialBackground(1, 1, 1);
  GL11.glEnable(GL13.GL_MULTISAMPLE);
  GL11.glViewport(0, 0, WIDTH, HEIGHT);
  </code></pre>
  
  <p>initialization method:</p>
  
  <pre><code>glMatrixMode(GL_PROJECTION);
  glOrtho(0, width, height, 0, -1, 1);
  glMatrixMode(GL_MODELVIEW);
  glClearColor(0, 1, 0, 0);
  
  textureID = loadTexture("res/hud.png");
  
  glEnable(GL_TEXTURE_2D);
  </code></pre>
  
  <p>rendering method:</p>
  
  <pre><code>glClear(GL_COLOR_BUFFER_BIT);
  
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  
  glPushMatrix();
  
  glTranslatef(0, 0, 0);
  
  glBindTexture(GL_TEXTURE_2D, textureID);
  
  glBegin(GL_QUADS);
  
  {
          glTexCoord2f(0, 0);
          glVertex2f(0, 0);
  
          glTexCoord2f(1, 0);
          glVertex2f(width, 0);
  
          glTexCoord2f(1, 1);
          glVertex2f(width, height);
  
          glTexCoord2f(0, 1);
          glVertex2f(0, height);
  }
  
  glEnd();
  glPopMatrix();
  </code></pre>
  
  <p>Does anyone know how I could get this code working with the contextAttribs?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Edit 1: I have all the functions and variables in GL11 statically imported.</p>