Skip to main content
GameDev.net gamedev.net
🔒 Locked

JOGL: javax.media.opengl vs. net.java.games.jogl

Started by jamesdk2006 May 17, 2008 at 10:32 AM 0 replies 3.7k views
Original Post
jamesdk2006
jamesdk2006
So I've been trying to learn some OpenGL for java and following along the tutorials, but I've run across my frist discrepency between the new and old versions of JOGL i think. The tuorial imports javax.media.opengl.* when I had been importing net.java.games.jogl. What is the difference between the two? Which one is newer? Also this is the error I am getting setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //only three JOGL lines of code ... and here they are GLCapabilities glcaps = new GLCapabilities(); GLCanvas glcanvas = GLDrawableFactory.getFactory().createGLCanvas(glcaps); glcanvas.addGLEventListener(new SimpleGLEventListener()); //add the GLCanvas just like we would any Component getContentPane().add(glcanvas, BorderLayout.CENTER); setSize(500, 300); //center the JFrame on the screen centerWindow(this); It says it can't find createGLCanvas in the javax.media.opengl pakcage.
greggles
greggles
Quote:
Original post by jamesdk2006
The tuorial imports javax.media.opengl.* when I had been importing net.java.games.jogl. What is the difference between the two? Which one is newer?


javax.media.opengl.* is the newer one, I think javax.media.opengl is from JOGL 1.1, while net.java.games.jogl is from JOGL 1.0. There are a few differences between them, you you may want to check out the documentation for the newer one.

Quote:
Original post by jamesdk2006
It says it can't find createGLCanvas in the javax.media.opengl pakcage.


That's probably because there is no such thing as createGLCanvas(caps) in GLDrawableFactory. I think that may be something from JOGL 1.0. As of the version I have (1.1.1), you can directly instantiate a GLCanvas with GLCapabilities via its contructor.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.