Presenting: The JOGL demo box!

Yep.
Just like the old DemoBox for Java4GL there’s now a JOGL demobox.

The demobox allows special jars to be clicked on and executed in a window presenting a common framework/format to distribute and view JOGL demo code.

All you need to do is inheriting from GLEventListener and specify the class name in your jar manifest.
Optionally you can add an HTML file to display information/instructions about your demo to the user.

Get it here http://www.furi.dk/java/

Full source as well as two simple demo jars included.

Available DemoBox examples from me:

  • MD2 Load/animation example with weapon change.
  • Picking example.
  • Occlusion culling.
  • GLSL shaders (per pixel specular lighting)
  • Simple mesh loading/drawing.
  • Displacement (parallax) mapping example using GLSL.

Hi,

I want to run your MD2 demo and see what your talking about, but I don’t understand.

I download your ZIP file, and it contains three Jar files. What is the main class to run it?

Can you setup a WebStart demo?

Thanks,

Simply double-click on the JOGLBox.jar file to run it.
Then you’re presented with a list of jars which you can simply click on. If that does not do it for you, type java -jar JOGLBox.jar at the command line :slight_smile:

Notice that the MD2 demo is a different download available from the same URL.

Alpha 2 of JOGLBox uploaded btw.

Okej first of all, very nice demo, I think this is a great way to show off javademos, But you should either make it webstartable or package the jogl-lib with the application and start it with a script because when I downloaded and tried to run it, it didnt work because jogl was missing (I never install jogl-libs in the jre) and it took some time to set things up. Oh btw, it looks like main-class is missing in the manifest?

Keep up the good work!
// Gregof

Well. A webstart might be an idea, although I always have JOGL installed in the JRE due to me being a java developer working primarily with JOGL projects :slight_smile:

I’ll take it into consideration.
The JOGLBox.jar is double-clickable on my windows and mac computers respectively. If you mean the demos, they do not use manifests as the main demo class is named after the JAR and I got tired of making manifests that said the same thing :slight_smile:

Sorry, i must have missed the mainclass-attrib when I looked at your manifest, its there :slight_smile:
I am a javadeveloper to and mainly use jogl, but I think that it is better to have have all libs with the application and set the classpath and librarypath in a script, because then the app is selfcontained and the user dont have to worry about installaing some lib (not to mention the possibility for mixing up the wrong libs and putting it in the wrong jre etc.)

// Gregof

You are ofcourse right, but I wanted it to run on all platforms out of the box without worrying about scripts etc.
And it’s for developers mainly.
Maybe I’ll do a consumer version later. It could be used as a framework for different computer games etc :slight_smile:

Hi ozak buddy,

Nothing I love more then someone who gives to the public community in the form of help or source code.

If I can help I’ll try, but I’m not very good at the webstart thing.

Here is a template that might get it working. Maybe this JNLP file will or someone else can mod it to work.


<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for JOGLBox Demo -->
<jnlp spec="1.0" codebase="http://www.furi.dk/java/">

  <information>
    <title>JOGLBox Demo By Ozak</title>
    <vendor>Ozak Technology, Inc.</vendor>
    <homepage href="http://www.furi.dk"/>
    <description>JOGLBox Demo By Ozak</description>
    <description kind="short">A demo of the capabilities of the JOGL.</description>
    <offline-allowed/> 
  </information>

  <security>
      <all-permissions/>
  </security>

  <resources>
    <j2se version="1.5+" java-vm-args="-esa -Xnoclassgc"/>
    <property name="sun.java2d.noddraw" value="true"/>

    <jar href="JOGLBox.jar" main="true"/>
    <extension name="jogl" href="https://jogl.dev.java.net/webstart/jogl.jnlp" />
  </resources>

  <application-desc main-class="????????I don't know????">
  </application-desc>
</jnlp> 

You will need to sign your Jar files.

Thanks. I’ve made a webstart version available now. Actually you can only get it through webstart. Source still included though if you can find the jar location ;D

Get it here: http://www.furi.dk/java/webstart/JOGLBox.jnlp

Ehum, why java 1.5?

// Gregof

ops, that might have been my fault.

Our project uses 1.5 and I copied the webstart file from there.

sorry about that.

I modfied it to 1.4.2 for the actual webstart as that is what I use. And yes. It runs on pre-tiger OSX :slight_smile:

Added FPS + it remembers and loads last demo directory :slight_smile:

Does not work for me :frowning:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: net/java/games/jogl/GLEventListener

I am using WinXP and JRE 1.5.0_01 and javaws displays JoglBox and Jogl as installed. What could be wrong?

And I have never installed Jogl anywhere in the JRE, just in case someone wants to ask :wink:

Hmm. This is quite odd. It seems like it can’t find JOGL for some reason. Could you try turning on the java console in the webstart options and posting the output here?

Maybe that could give some clue as to what is wrong :slight_smile:

unfortunatly that is the output of the java console :wink:

here is some more of the trace:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: net/java/games/jogl/GLEventListener
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at java.security.SecureClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.defineClass(Unknown Source)
      at java.net.URLClassLoader.access$100(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at JOGLBox.valueChanged(JOGLBox.java:270)

here is the jnlp-descriptor shown for the Joglbox


<jnlp spec="1.0" codebase="http://www.furi.dk/java/webstart/">
  <information>
    <title>JOGLBox Demo Viewer By Ozak</title>
    <vendor>furi.dk</vendor>
    <homepage href="http://www.furi.dk"/>
    <description>JOGLBox Demo Viewer By Ozak</description>
    <description kind="short">Common platform for viewing JOGL demos.</description>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <j2se java-vm-args="-esa -Xnoclassgc" version="1.4.2+"/>
    <property name="sun.java2d.noddraw" value="true"/>
    <jar href="http://www.furi.dk/java/webstart/JOGLBox.jar" download="eager" main="true"/>
    <extension href="https://jogl.dev.java.net/webstart/jogl.jnlp" name="jogl"/>
  </resources>
  <application-desc main-class="JOGLBox"/>
</jnlp>

and the one for the jogl library:


<jnlp spec="1.0.1" codebase="https://jogl.dev.java.net/webstart/" href="https://jogl.dev.java.net/webstart/jogl.jnlp">
  <information>
    <title>JOGL</title>
    <vendor>Sun Microsystems, Inc.</vendor>
    <homepage href="http://jogl.dev.java.net/"/>
    <description>JOGL</description>
    <description kind="short">Java programming language binding for the OpenGL 3D graphics API.</description>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <jar href="https://jogl.dev.java.net/webstart/jogl.jar" download="eager" main="false"/>
    <jar href="https://jogl.dev.java.net/webstart/jogl-natives-win32.jar" download="eager" main="false"/>
  </resources>
  <library-desc unique-id="null"/>
</jnlp>

I have not much understanding in webstart, but could the jogl jnlp be corrupt because of the “null” library-desc entry?

Hmm. It’s definately because it can’t find JOGL.
Strange.
The webstart thingie works fine on my work PC, my home PC as well as on my IBook so it’s probably ok :slight_smile:

Hi
I see you have changed your jnlp-file so it specifies 1.4.2+ now. I have 1.4.2_04 for linux and when I run your prog, the jre-installer for 1.5.0_02 pops up, any idea why?

// Gregof

Well. On windows it automatically installs the 1.5.2 via. their update system, so maybe it’s the same on linux?