I have noticed that jogl has a jsr-231 beta 01 build, and I have
some questions:
-
In the previous version, my program like this:
public class Demo extends Frame implements GLEventListener {
public void init(GLDrawable drawable) {
GL gl = drawable.getGL();
gl.glShadeModel(GL.GL_SMOOTH);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
gl.glClearDepth(1.0);
gl.glEnable(GL.GL_DEPTH_TEST);
}
public void reshape(GLDrawable drawable, int x, int y, int width, int height) {
GL gl = drawable.getGL();
float h = (float)height / (float)width;
gl.glViewport(0, 0, width, height);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
gl.glFrustum(-1.0f, 1.0f, -h, h, 2.0f, 60.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
}
public void display(GLDrawable drawable) {
GL gl = drawable.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
gl.glFlush();
}public void displayChanged(GLDrawable drawable, boolean modeChanged,
boolean deviceChanged) {}
}
In the jsr-231 version, there is a GLAutoDrawable class which extends GLDrawable, what is the difference between them? Should I use GLAutoDrawable instead of GLDrawable?
- It seems that GLAutoDrawable only has a getGL() method, but
hasn’t a getGLU() method, how can I get the GLU object?
Thanks!