Hi
I have only just begun to learn JOGL, i have written several basic programs, but they have all had the same problem. All the drawing works correctly, but when the window is first displayed it is a tiny little square in the top left corner. If the bottom right corner is dragged to expand the window then as I said the drawing is displayed correctly.
Here is the code that i thought was supposed to set the viewable size of the GLCanvas:
1 2 3 4 5 6 7 8 9 10 11 12
| public void init(GLAutoDrawable drawable) { GL lib = drawable.getGL(); GLU glu = new GLU(); lib.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); lib.glViewport(-500, -300, 500, 300); lib.glMatrixMode(GL.GL_PROJECTION); lib.glLoadIdentity(); glu.gluOrtho2D(-500.0, 500.0, -300.0, 300.0); } |