Thanks for the suggestion. I can believe I am creating the context wrong because sometimes the applet comes up black on Windows, and a browser refresh is required. Perhaps it is a timing issue.
Given your suggestion, I've changed my code to the following:
public class OpenGLReport extends JApplet implements GLEventListener {
public void init() {
GLProfile profile = GLProfile.get(new String[] { /* ... */ });
GLCapabilities capabilities = new GLCapabilities(profile);
GLCanvas canvas = new GLCanvas(capabilities);
add(canvas);
canvas.addGLEventListener(this);
Animator animator = new Animator(canvas);
animator.start();
}
@Override
public void init(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
String[] extensions = gl.glGetString(GL.GL_EXTENSIONS).split(" ");
// ...
This works in Eclipse on Windows, but fails with a null reference exception in JOGL on Mac:
java.lang.NullPointerException
at com.jogamp.opengl.impl.gl4.GL4bcImpl.glGetString(GL4bcImpl.java:10315)
Also, it appears that I need to create the animator for init(GLAutoDrawable) to get called, but this class is not in the old signed jars for web applets. Is there another way to do this? Do you have a simple example that just creates a context and makes GL calls?
What initialization is my original code missing that I achieve by using init(GLAutoDrawable)?
Thanks!
Patrick