JOGL2 ES1 RedSquare problems

‘Day 2 with NetBeans’

So yesterday I created myself a JOGL2 Library for use with netbeans consisting of all the mac osx universal jars (from overnight build). I have a new NB project for Java Application and ‘add’ this new library. Next I set up the java.library.path to point to the native libs. All good so far.

Tested the ES2 demo of RedSquare and pleased to say it works fine :slight_smile:

Then I tried the ES1 RedSquare demo and hit the following exception:

java.lang.RuntimeException: Unexpected buffer type java.nio.DirectDoubleBufferU
at com.sun.gluegen.runtime.BufferFactory.isDirect(BufferFactory.java:98)
at com.sun.opengl.impl.gl2.GL2Impl.glMultMatrixd(GL2Impl.java:9915)
at com.sun.opengl.impl.gl2.ProjectDouble.gluPerspective(ProjectDouble.java:567)
at javax.media.opengl.glu.gl2.GLUgl2.gluPerspective(GLUgl2.java:321)
at RedSquare.reshape(RedSquare.java:205)
at com.sun.opengl.impl.GLDrawableHelper.reshape(GLDrawableHelper.java:101)
at com.sun.javafx.newt.opengl.GLWindow$DisplayAction.run(GLWindow.java:586)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:156)
at com.sun.javafx.newt.opengl.GLWindow.display(GLWindow.java:528)
at RedSquare.display(RedSquare.java:135)
at RedSquare.run(RedSquare.java:120)
at RedSquare.main(RedSquare.java:276)

Any ideas what I might have done wrong with my setup?

I fear the buffer created is not direct when using ES1. You should look at the source code to confirm.

Yes I tried digging though some of the code (found versions via google code) but the rendering is using FloatBuffers not DoubleBuffers, so I suspect this is something deeper still inside the GLU stuff because that seems to be referencing GL2 rather than ES1.

Anyway I’m starting to think this isn’t a problem with my setup, but more with the ES1 demo or something underneath.

You are using the gluegen-rt-cdc variant (just released for CVM) …
which does not contain Double- or Long Buffers.
You cannot use the CDC JARs for non CVM virtual machines.

GL2 is chosen in your GLProfile, which implies using GLUgl2 and java.nio.DoubleBuffer usage.
You can try a more embedded like profile on the desktop using the JOGL_GL2ES12 setup e.g.:

./jogl-demos> . ./setenv-jogl.sh JOGL_GL2ES12_MIN …/jogl/build-x86_64

This uses the GlueGen/JOGL JARS:

gluegen-rt.jar
nativewindow.core.jar
jogl.core.jar
jogl.util.jar
jogl.gl2es12.x11.jar
jogl.util.fixedfuncemu.jar
newt.core.jar
newt.ogl.jar

where the GL2ES12 stuff gives you an implementation of the GLProfile’s GL2ES1 and GL2ES2,
not a complete GL2 !

http://kenai.com/projects/jogl/pages/FAQ#How_to_develop_Cross-Device_Applications