public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) { GL2 gl = drawable.getGL().getGL2(); // gl.glViewport(0, 0, w, h); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); glu.gluOrtho2D(0.0, (double) w, 0.0, (double) h); }
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); }
@Override public void reshape( final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { final GL2ES1 gl = drawable.getGL().getGL2ES1(); gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION); gl.glLoadIdentity(); // coordinate system origin at lower left with width and height same as the window glu.gluOrtho2D(0.0f, width, 0.0f, height); gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); gl.glLoadIdentity(); gl.glViewport(0, 0, width, height); }