Adding JOGL into an Existing Netbeans Project

I have an existing Project, created a long ago, and I want to add JOGL into it, so I do not have to throw away all my CVS history, or make two projects. I added the JOGL library to the project properties. The line new GLCanvas(); throws java.lang.NoClassDefFoundError: com/sun/gluegen/runtime/DynamicLookupHelper.

I then added the gluegen-rt library into the project to see what would happen, even though a brand new Simple JOGL project does not have it. Now the error is java.lang.UnsatisfiedLinkError: no jogl in java.library.path.

I can run the Simple JOGL project that comes with the Netbeans OpenGL plugin. I can add the line new GLCanvas(); to main(), and everything works fine. When looking at it’s projects properties, it just shows JOGL, but there is an error down at the bottom of the dialog box, say “Some library items cannot be located”.

Are there any directions to modifying an existing project to do this, or should I reverse engineer it, looking at simple JOGL’s proect files?

More info: The Run tab of the Simple JOGL Library shows the error. it looks something like:
Broken reference: ${javac.classpath}${path.separator}${build.classes.dir}

Looking at the project.properties file for Simple OpenGL, found these unique lines:

natives.platform=macosx-universal

run-sys-prop.java.library.path=
${libs.JOGL.classpath}-natives-${natives.platform}${path.separator}
${libs.GLUEGEN-RT.classpath}-natives-${natives.platform}

Assuming everything was backed up first. What I think I am going to try first is add all my references into a simple OpenGL project, then the minimal changes so it can can replace my old project.properties, and see if it works.

Wondering if Netbeans OpenGL projects need changing inorder to develop between native platforms?

The missing dependency in the libraries node and the broken reference message are minor bugs of the prerelease in beta 1 and 2.

For the UnsatisfiedLinkError, you could try to simple update your project.properties with the natives.platform and run-sys-prop.java.library.path from the SimpleJOGL project.

For development between platforms, you have to override this settings in your projects private folder.

Tried it my way first even though there are more changes. Many can be done with with the IDE, the manual ones are dealing with things I understand. It gets a lot farther, probably beyond this threads scope. It produced a java.libray.path of:
.netbeans/6.0beta2/libs/jogl.jar-natives-macosx-universal:
.netbeans/6.0beta2/libs/gluegen-rt.jar-natives-macosx-universal

Did die with a Java Result: 138. MacOS then brought up a dialog to report it. I am going to hold off on that. I am probably commiting some atrocities, and just now able to get that far.

So… the java result 138 is your fault or ours? ::slight_smile:

you tell me. For error isolation purposes I did the following to a fresh simple JOGL:

put the lines
GLCanvas can = new GLCanvas();
GLContext con = can.createContext(null);
GL gl = con.getGL();

        gl.isExtensionAvailable("GL_ARB_fragment_program");

right at the front. The isExtensionAvailable produced the abort.

I did the same thing on Win/XP & Netbeans 6.0 beta 1, with a Simple JOGL created on that machine. This time I got just an illegal Argument exception. Clearly I am doing something wrong, but the MacOS response does seem a little harsh.

Ah, OK. Not our fault :stuck_out_tongue: (we are only producing the NetBeans plugin)

You have to call GL functions at a time where the GL context is current. Best would be to use the GLEventListener mechanism and check extensions in the init() callback.

Alternatively you could call afaik makeCurrent() yourself.
http://ls7-www.cs.uni-dortmund.de/students/lectures/doc_mmi0708/puebungen/jogl-1_0_0-docs/javax/media/opengl/GLContext.html