protected static void setup(GL pGL, int width, int height) {
    pGL.getGL2().glMatrixMode(GLMatrixFunc.GL_PROJECTION);
    pGL.getGL2().glLoadIdentity();

    // coordinate system origin at lower left with width and height same as the
    // window
    final GLU glu = new GLU();
    glu.gluOrtho2D(0.0f, width, 0.0f, height);

    pGL.getGL2().glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
    pGL.getGL2().glLoadIdentity();

    pGL.glViewport(0, 0, width, height);
  }
Exemple #2
0
 public final void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
   GL gl = drawable.getGL();
   gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
   gl.glViewport(0, 0, width, height);
   return;
 }