This is what I use for
JOGL:
you would use code like the following to make sure you are using an orthagonal setup:
gl.glViewport(0, 0, width, height);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0.0f, width, 0.0f, height, 0.0f, 10000.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
the above code should be placed inside your
reshape method so that you can draw a quad using the following at your intended location (placed inside your
display method:
// Make sure you set a drawing state colour before you continue with the following code:
gl.glBegin(GL.GL_QUADS);
gl.glVertex2f(200.0f, 200.0f);
gl.glVertex2f(400.0f, 200.0f);
gl.glVertex2f(400.0f, 400.0f);
gl.glVertex2f(200.0f, 400.0f);
gl.glEnd();
Spend some time looking at the nehe demos as people have pointed towards above this post. Lots of good stuff to be learnt there. :D
edit - fixed some spellings. :)