Newbie Issue: JOGL Problems With jdk 5 in linux

Folks-

I am runnin jsdk1.5.0_02, and I built the jogl libraries successfully according to the ant build provided. I have added the jogl.jar to my CLASSPATH, and the library to my LD_LIBRARY_PATH environment variable as requested. I am working in Redhat Linux 9.

I downloaded the Gears.java source file, and I am attempting to compile this relatively simple starter demo. The build give me the following warning and error;

Gears.java:42: warning: [deprecation] show() in java.awt.Window has been deprecated
frame.show();
^
Gears.java:58: cannot find symbol
symbol : method setSwapInterval(int)
location: interface net.java.games.jogl.GL
gl.setSwapInterval(1);
^
1 error
1 warning

I am having similar problems with Java3D in linux.

Is there something I have overlooked? Are there functions/classes in java 5 that has been deprecated which I an not aware of? In the latter event perhaps I could take a look at the functions indicated here as not existing or being deprecated and/or the source code for Java3D and JOGL (possibly).

If not, then is there something I have failed to include which is causing this warning and error?

Thanks-

-Steve Farris

The first is a deprecated method and is not very serious. If you want to get rid of it you just change it to

frame.setVisible(true);

and the compiler will be happy.

Concerning the setSwapInterval, normally if it is really an opengl method it should come like

gl.glsetSwapInterval()

try to see if it compile afterwards.

However as it is one of the demo it is strange it is not compiling.

Look in jogl-demos-src.zip for the version of the demos compatible with the version of JOGL you downloaded. The demos in the CVS repository are compatible with the JOGL sources in the CVS repository which haven’t been shipped in binary form yet.

I modified the function frame.show() to frame.setVisible(true), and this worked fine as Malek kindly pointed out.

I attempted to rename the gl.setSwapInterval(1)
to gl.glsetSwapInterval(1) and several other possible variants of this…
for example; I tried glSetSwapInterval(1), and calls with no arguments as Malek’s format might suggest. None of these formats worked. So, I commented
out the gl.setSwapInterval(1) call, and the program worked with sort of erratic animation. The setSwapInterval was supposed to reduce the erratic nature of the animation. So, if anyone might know the work around, that would be appreciated.

Otherwise, thanks to Malek for the ideas which basically worked!

-Steve Farris

The setSwapInterval() call is new and will be present in the forthcoming JOGL 1.1 b11. It provides platform-independent control over syncing to the vertical retrace; see JOGL Issue 92. It has to be called with the OpenGL context active; there are some limitations in JOGL’s architecture that would have made it difficult to do context manipulation around this call which is why it was placed in the GL interface rather than the GLDrawable interface. This will probably change in the JSR-231 implementation.