JOGL Project Template available for NetBeans

Theres an update available:

  • Updated jogl libraries to JSR-231 beta5
  • Added support for additional target platforms
  • Added the Particle Engine Demo
  • Added simple syntax highlighting GLSL shader editor.

You can download the available modules here:

http://cylab.codewut.de/nbms/50/net-highteq-gamedev-nbm-joglproject.nbm
http://cylab.codewut.de/nbms/50/net-highteq-gamedev-nbm-jogldemosproject.nbm
http://cylab.codewut.de/nbms/50/com-thoughtworks-xstream.nbm (needed for the GLSL editor)
http://cylab.codewut.de/nbms/50/net-highteq-gamedev-nbm-glsleditor.nbm

Or setup an Update-Center:

Tools->Options->[AdvancedOptions]
(+)IDE Configuration
(+)System
(+)Autoupdate Types

Add a new “General Update Center” via right click context menu, name it and change the Server URL on the new entry to http://cylab.codewut.de/nbms/50.xml.
After that you can install the modules via Tools->Update Center.

Please have a look and report success or problems on other platforms than windows => Thanks!

=============================================================

NOTE: Projects created with the previous version do not work after this update.
I recommend creating a new project and copying the contents of your “src” folder to it.

Alternatively you can fix your project by…

  • …changing the jogl.natives entry around line 40 in nbproject/project.properties to a full qualified native name. Available natives:

  jogl-natives-linux-i586
  jogl-natives-linux-amd64
  jogl-natives-macosx-ppc
  jogl-natives-macosx-universal
  jogl-natives-solaris-sparc
  jogl-natives-solaris-sparcv9
  jogl-natives-solaris-i586
  jogl-natives-windows-i586

  • …and exchanging the -post-jar target in your build.xml by the following:

  <target name="-post-jar">
      <echo message="Creating native distibutions"/>
      <dirname property="jogl.libs" file="${libs.JOGL.classpath}"/>

      <mkdir dir="${dist.dir}-linux-i586"/>
      <copy todir="${dist.dir}-linux-i586">
          <fileset dir="${dist.dir}" defaultexcludes="no"/>
          <fileset dir="${jogl.libs}/jogl-natives-linux-i586"/>
      </copy >

      <mkdir dir="${dist.dir}-linux-amd64"/>
      <copy todir="${dist.dir}-linux-amd64">
          <fileset dir="${dist.dir}" defaultexcludes="no"/>
          <fileset dir="${jogl.libs}/jogl-natives-linux-amd64"/>
      </copy >

      <mkdir dir="${dist.dir}-macosx-ppc"/>
      <copy todir="${dist.dir}-macosx-ppc">
          <fileset dir="${dist.dir}" defaultexcludes="no"/>
          <fileset dir="${jogl.libs}/jogl-natives-macosx-ppc"/>
      </copy >

      <mkdir dir="${dist.dir}-macosx-universal"/>
      <copy todir="${dist.dir}-macosx-universal">
          <fileset dir="${dist.dir}" defaultexcludes="no"/>
          <fileset dir="${jogl.libs}/jogl-natives-macosx-universal"/>
      </copy >

      <mkdir dir="${dist.dir}-solaris-sparc"/>
      <copy todir="${dist.dir}-solaris-sparc">
          <fileset dir="${dist.dir}" defaultexcludes="no"/>
          <fileset dir="${jogl.libs}/jogl-natives-solaris-sparc"/>
      </copy >

      <mkdir dir="${dist.dir}-solaris-sparcv9"/>
      <copy todir="${dist.dir}-solaris-sparcv9">
          <fileset dir="${dist.dir}" defaultexcludes="no"/>
          <fileset dir="${jogl.libs}/jogl-natives-solaris-sparcv9"/>
      </copy >

      <mkdir dir="${dist.dir}-solaris-i586"/>
      <copy todir="${dist.dir}-solaris-i586">
          <fileset dir="${dist.dir}" defaultexcludes="no"/>
          <fileset dir="${jogl.libs}/jogl-natives-solaris-i586"/>
      </copy >

      <mkdir dir="${dist.dir}-windows-i586"/>
      <copy todir="${dist.dir}-windows-i586">
          <fileset dir="${dist.dir}" defaultexcludes="no"/>
          <fileset dir="${jogl.libs}/jogl-natives-windows-i586"/>
      </copy >

      <copy todir="${dist.dir}">
          <fileset dir="${jogl.libs}/${jogl.natives}" defaultexcludes="yes"/>
      </copy >
  </target>

Has this link moved? It worked a couple weeks ago but I have not been able to get there in the past couple days.

Thanx. Andy

We are currently moving to a new server and hosting provider and I am upgrading to the final JSR. Please take a look next weekend.

Thanx for the template and the update. It helps a lot.

Andy

I have tried to download this several times with no success. The server does not respond.

e.g.

C:\Documents and Settings\bill>wget -d http://cylab.codewut.de/nbms/50.xml
DEBUG output created by Wget 1.10.2 on cygwin.

–15:45:27-- http://cylab.codewut.de/nbms/50.xml
=> `50.xml’
Resolving cylab.codewut.de… 80.190.244.218
Caching cylab.codewut.de => 80.190.244.218
Connecting to cylab.codewut.de|80.190.244.218|:80… connected.
Created socket 3.
Releasing 0x10041fb8 (new refcount 1).

—request begin—
GET /nbms/50.xml HTTP/1.0
User-Agent: Wget/1.10.2
Accept: /
Host: cylab.codewut.de
Connection: Keep-Alive

—request end—
HTTP request sent, awaiting response…

Sorry all, I had no time to work on this earlier. The modules are online again and hosted on a new server, so I hope there will be less downtimes in future. Right now the modules are several month old and still use the latest jsr beta version. I’ll try to update them as soon as possible. Updates will be available vie the update center and announced here. Projects based on this version should be compatible to the upcoming update.

Best Regards
Mathias

I just updated the project template to JOGL JSR-231 1.1.0-RC3. You can download the available modules here:

http://cylab.codewut.de/nbms/50/net-highteq-gamedev-nbm-joglproject.nbm
http://cylab.codewut.de/nbms/50/net-highteq-gamedev-nbm-jogldemosproject.nbm

Or download and install the Update-Center:

http://cylab.codewut.de/nbms/50/net-highteq-gamedev-nbm-updatecenter.nbm

After that you can install the modules (and keep track of future updates) via the “Gamedev Updatecenter” under |Tools|->|Update Center|.

Note: I modified my code that generates the template to make it more easy to create an update, so you can expect future updates to follow the regular JOGL releases.

just added the gamecenter to my updates and installed the glsl editor (only this component), which seem to work fine. Syntax Highlighting or not realy makes a difference… :slight_smile:

thanks for providing this!

Thanks for your Feedback ::slight_smile:

Cylab: Perhaps you should update the first post as well? I got into this forum looking for a quick way to get JOGL to work, so I used your old update-site from the first post and ran into problems with the glugen.rt path not being specified etc. I’m gonna try with the new update site now. Natrually not everyone is as ignorant as me and reads on instead, but some dummies are bound to start bugging you because it’s not working.

If it works I’m very grateful since I was looking for a quick way to get it to work and get my hands dirty. A lot of tutorials I found used the net.java.gaming package. Hard for a newbie to understand what was wrong (I installed the latest rc).

Edit: My bad, they were the same. When I try to build your test project I get this error (stack trace):

Exception in thread "main" java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at com.sun.gluegen.runtime.NativeLibLoader$1.run(NativeLibLoader.java:68) at java.security.AccessController.doPrivileged(Native Method) at com.sun.gluegen.runtime.NativeLibLoader.loadGlueGenRT(NativeLibLoader.java:66) at com.sun.gluegen.runtime.NativeLibrary.ensureNativeLibLoaded(NativeLibrary.java:399) at com.sun.gluegen.runtime.NativeLibrary.open(NativeLibrary.java:163) at com.sun.gluegen.runtime.NativeLibrary.open(NativeLibrary.java:129) at com.sun.opengl.impl.x11.DRIHack.begin(DRIHack.java:109) at com.sun.opengl.impl.x11.X11GLDrawableFactory.<clinit>(X11GLDrawableFactory.java:99) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:111) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:113) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:82) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:75) at org.yourorghere.SimpleJOGL2.main(SimpleJOGL2.java:22) Java Result: 1

I get the same in Eclipse so perhaps this don’t have anything to do with your code. I just generated your project without any changes. If anyone knows how to help me I’d be very grateful!

Edit2: Tried running with this. No change.
-Djava.library.path=/home/magnus/Filer/gluegen-rt.jar;/home/magnus/Filer/jogl.jar;/home/magnus/Filer/jogl-linux-natives-i586.jar

What platform are you running on? I just tested this on wndows, so there might be something wrong with the *nix setup of my template :confused:
cylab

Hi i got the same error as Mange:
Exception in thread “main” java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at com.sun.gluegen.runtime.NativeLibLoader$1.run(NativeLibLoader.java:68)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.gluegen.runtime.NativeLibLoader.loadGlueGenRT(NativeLibLoader.java:66)
at com.sun.gluegen.runtime.NativeLibrary.ensureNativeLibLoaded(NativeLibrary.java:399)
at com.sun.gluegen.runtime.NativeLibrary.open(NativeLibrary.java:163)
at com.sun.gluegen.runtime.NativeLibrary.open(NativeLibrary.java:129)
at com.sun.opengl.impl.x11.DRIHack.begin(DRIHack.java:109)
at com.sun.opengl.impl.x11.X11GLDrawableFactory.(X11GLDrawableFactory.java:99)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:111)
at javax.media.opengl.GLCanvas.(GLCanvas.java:113)
at javax.media.opengl.GLCanvas.(GLCanvas.java:82)
at javax.media.opengl.GLCanvas.(GLCanvas.java:75)
at org.tests.SimpleJOGL.main(SimpleJOGL.java:22)

I’m running Kubuntu, so i guess that it might be some linux issue with your template.
Very nice work though //
Gregof

Thanks for testing this out. I guess you tried to run the app through netbeans “play”-button!? Would you mind to add


System.out.println(System.getProperty("java.library.path"));

to the main-method of the SimpleJOGL class and post the result here?

Thanks
cylab

Sure, it prints: /opt/netbeans-5.5/nb5.5/libs/jogl.jar/…/jogl-natives-linux-i586
And yes, I used the “play”-button.
// Gregof

could you please check, if there is a “libgluegen-rt.so” in “/opt/netbeans-5.5/nb5.5/libs/jogl-natives-linux-i586”?

There is:
/opt/netbeans-5.5/nb5.5/libs/jogl-natives-linux-i586$ ls
libgluegen-rt.so libjogl_awt.so libjogl_cg.so libjogl.so
// Gregof

Strange. Maybe I packaged the wrong binaries!? Is there any way to check if the libgluegen-rt.so is suitable for your platform? If so, would you mind doing that?

Another test would be to create a distribution, by right-clicking the project node and select “build project”.
After that, open a shell and go to the dist-linux-i586 folder in the projects directory. Type


java -jar SimpleJOGL.jar -Djava.library.path=./

and post the result.

Thanks for helping!
cylab

Hi again
I’m not sure how to check if the libgluegen-rt.so is correct for my plattform, I did a ldd though;
ldd -v libgluegen-rt.so
linux-gate.so.1 => (0xffffe000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7dc9000)
/lib/ld-linux.so.2 (0x80000000)

    Version information:
    ./libgluegen-rt.so:
            libc.so.6 (GLIBC_2.1.3) => /lib/tls/i686/cmov/libc.so.6
    /lib/tls/i686/cmov/libc.so.6:
            ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
            ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
            ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
            ld-linux.so.2 (GLIBC_2.0) => /lib/ld-linux.so.2

If someone knows a way to verify that these are the correct binaries, i would love to know :slight_smile:
I tried running from the shell to, it produces exactly the same result.
// Gregof

first: my shell command posted above was wrong


java -Djava.library.path=. -jar SimpleJOGL.jar

should work.

second: I found the bug…
I made the wrong asumption, that “/foo/bar/jogl.jar/…/jogl-natives-linux-i586” resolves to “/foo/bar/jogl-natives-linux-i586” on linux, which is wrong. “/foo/bar/jogl.jar/…/jogl-natives-linux-i586” simple is an invalid path on linux :confused:

I have to change the libraries layout in the module to fix that. In the meanwhile, open the “nbproject/project.properties”-file and change the property “run-sys-prop.java.library.path” (line 59) to your jogl-natives folder in the netbeans-installation (e.g for gregorf: /opt/netbeans-5.5/nb5.5/libs/jogl-natives-linux-i586)

Sorry about that :confused: I’ll post an update soon.

cylab

Hi, thank you for fixing this.
With the changes to nbproject/project.properties it worked, I cant belive I missed the broken path before ;D
I look forward to the next version, keep the good work up!
// Gregof