What controls which interface GLAutoDrawable.getGL() returns?
问题 In trying to work through tutorials on JOGL, I run into trouble when entering this part of the code: @Override public void display(GLAutoDrawable glad) { GL gl = glad.getGL(); gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glBegin(GL.GL_TRIANGLES); This doesn't compile because glBegin is not a method in GL even though the online tutorials use it that way. By digging around in the JOGL javadoc I found that I could get the tutorial to work by doing this: GL2 gl = (GL2) glad.getGL(); Then all the