Login  Register

Context creation failed on MacBook Pro

Posted by pjcozzi on Nov 10, 2010; 4:14pm
URL: https://forum.jogamp.org/Context-creation-failed-on-MacBook-Pro-tp1876910.html

Hi,

Can anyone spot anything wrong with the following code?  It works on several flavors of Windows but fails on a MacBook Pro:  gl (the last line) is null.

public class OpenGLReport extends JApplet {
  public void init() {
    GLProfile profile = GLProfile.get(new String[] { GLProfile.GL4bc, GLProfile.GL3bc, GLProfile.GL2 });
    GLCapabilities capabilities = new GLCapabilities(profile);
    GLCanvas canvas = new GLCanvas(capabilities);
    add(canvas);
    GLContext context = canvas.getContext();
    context.makeCurrent();
    GL gl = canvas.getGL();

This is in an applet that doesn't need to draw anything; it just needs to query OpenGL information.  I am using the signed jars hosted here:

   http://download.java.net/media/jogl/jsr-231-2.x-webstart

The MacBook has two video cards:  a NVIDIA GeForce GT 330M and an Intel one.  The NVIDIA card was active at the time.

Perhaps I am creating the context incorrectly?

Regards,
Patrick