This is Weird

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

This is Weird

joedizzle
To launch a jogl application for my system which has Opengl 3.3

        GLProfile profile = GLProfile.getDefault();
        GLCapabilities glp = new GLCapabilities(profile);
        GLCanvas canvas = new GLCanvas(glp);

But the latest build version 2.0-b367-20110405 does not have GLCapabilities(GLProfile profile) constructor. Then how do you go getting started with jogl?

By the way Netbeans tells me that GLCapabilities class has only the default constructor, but no parameter type constructor.

Here is my error println,

Exception in thread "main" java.lang.NullPointerException
        at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1584)
        at javax.media.opengl.GLProfile.isGL4bcAvailable(GLProfile.java:151)
        at javax.media.opengl.GLProfile.glAvailabilityToString(GLProfile.java:242)
        at javax.media.opengl.GLProfile.glAvailabilityToString(GLProfile.java:310)
        at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1283)
        at javax.media.opengl.GLProfile.access$000(GLProfile.java:71)
        at javax.media.opengl.GLProfile$1.run(GLProfile.java:117)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:115)
        at javax.media.opengl.GLProfile.validateInitialization(GLProfile.java:1428)
        at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:1580)
        at javax.media.opengl.GLProfile.get(GLProfile.java:623)
        at javax.media.opengl.GLProfile.getDefault(GLProfile.java:480)
        at javax.media.opengl.GLProfile.getDefault(GLProfile.java:486)
        at jogl.IntroToJogl.main(IntroToJogl.java:23)
Java Result: 1

For the code;

package jogl;

import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;

/**
 *
 * @author Joe Mwangi
 */
public class IntroToJogl
{
    public static void main(String [] args)
    {
        GLProfile profile = GLProfile.getDefault();
        GLCapabilities glp = new GLCapabilities(profile);
        GLCanvas canvas = new GLCanvas(glp);

        final Frame frame = new Frame("Intro to JOGL");
        frame.setSize(600, 600);
        frame.add(canvas);
        frame.setVisible(true);

        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                frame.dispose();
                System.exit(0);
            }
        });
    }
}
Reply | Threaded
Open this post in threaded view
|

Re: This is Weird

gouessej
Administrator
I still see this on the public repository:

/** Creates a GLCapabilities object. All attributes are in a default state.
* @param glp GLProfile, or null for the default GLProfile
*/
  public GLCapabilities(GLProfile glp) {
      glProfile = (null!=glp)?glp:GLProfile.getDefault(GLProfile.getDefaultDevice());
  }
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: This is Weird

joedizzle
Argggh! Sorry for any inconveniences caused. The jogl 1.x jar files were in my jvm ext folder hence the classpath conflict. I had forgotten abt them that they existed. But all in all thank you for ur help.