Getting started with Jogl: renders once and then that's it!

Newbie here with JOGL (but with 20+ years programming experience).

Summary: I have tried many of the JOGL demos available and this is what occurs:

  • The initial render happens successfully.
  • Then: NOTHING. Subsequent renders simply don’t do anything.

In the debugger, I traced it, and the display() callback is indeed getting called, the appropriate items are being changed, but then after it returns, and the swapBuffer() call is made by GLDrawableHelper, no change on the screen. Ever. The display just sits there with the initial image drawn but refuses to give any new updates to it.

But its even weirder: if I obscure the screen, then put a break in the relevant ‘display()’ routine, and trace it back to swapBuffer(), the image does come back after the swapBuffer() is called. But its the OLD initial image, not the image currently represented by the objects in the code. For example, the ‘diamond’ square is initially colored blue. The code will change it to green. But subsequent renders always show it as that initial blue. It is as if it has hold of an old buffer that it continually uses, and won’t swap any new buffers into place. But I don’t see anything weird or wrong anywhere.

Notes:

  • The regular C demos to OpenGL work fine. I downloaded and ran the ‘Cube’ demo which displays an animated rotating cube. No problem.

The following demos I downloaded and tweaked successfully so that they compiled from the old 1.1.1 formats to the new JS231 formats. That is, I had to do things like global replace net.java.games.jogl with javax.media.opengl:
- The tetrahedron example I copied from the wiki. http://en.wikipedia.org/wiki/Java_OpenGL
- Kevin Conroy’s tutorial from http://www.cs.umd.edu/~meesh/kmconroy/JOGLTutorial/
- Pepe & Lizzie’s port of the Nehe tutorials (http://pepijn.fab4.be/software/nehe-java-ports/)

I ran all these tutorials, including the first 10 of nehe…same thing: the initial render happens, but then no matter what you do, nothing else renders. The appropriate objects are indeed being modified, but it has no effect on the screen.

Stats:

  • I am running on an i686 linux ubuntu machine.
  • Jvm: java-6-sun
  • OpenGL: libglut.so.3.8.0
  • Jogl: 1.1.1

Can anybody give me a clue as what else I can try? Or what thing in my environment to check?
I played around with set auto swap buffer mode, hardware acceleration mode, ensuring I am calling glFinish() and even tried glFlush(), but none of that helped.

I looked around a fair bit on the web, and I am surprised that nobody else has encountered this.
??

Thanks,
Doug

Do you see the same thing if you run the demos via webstart from https://jogl-demos.dev.java.net/ as when you build them yourself?

I guess you’ve probably already tried that… it does sound weird, and I’m afraid I don’t think I can help much.

Are you sure your Ubuntu uses the Sun’s JDK? What do you get when you enter “java -version”? Please tell me more about your kernel version and your Xorg version. Which graphics card do you use? libglut.so.3.8.0 has nothing to do with OpenGL, it concerns GLUT. Maybe you should submit a bug report.

Hi Douglas,

Have you found the resolution or just abandoned JOGL ?

I have the same problem. Ubuntu 9.04 running Sun JDK 64 bit. Installed Netbeans JOGL plugin. Then run plugin wizard created examples:
SimpleJogl2 runs fine (it does not use AWT) but the other two SimpleGljPanel and Simple GLCanvas2 fail as in your case.

Java web start examples run fine.

Kind regards,

Agurkas

Oops !

Sorry guys,

I just spotted animator.start() call was missing in those plugin examples. After calling start it runs absolutely fine.

My bad…

Agurkas

I came here today to enquire about the very same problem on my new machine.

I’m running Kubuntu Karmic 64-bit with Sun Java 1.6.0_15-b03 and JOGL 1.1.1a on an Intel quad-core. My guess was that the problem is related either to the 64-bit JOGL or to multicore.

Update: I wonder whether it’s related to this code snippet from X11GLDrawable.java:

      XVisualInfo template = XVisualInfo.create();
      // FIXME: probably not 64-bit clean
      template.visualid((int) visualID);

Update2: probably not. Debugger says that my visualID is of the order of 200, so a cast from long to int won’t change anything.

Update3: copied a 32-bit version of Sun Java 1.6.0_14-b08 across from another machine and that works. Slim chance of it being a bugfix between minor versions 14 and 15, but my money’s on it being a 64-bit problem in JOGL.

Update4: if I replace the GLCanvas in the wiki JOGLTetrahedron example with GLJPanel then it works in 64-bit.

Thought that using the latest JOGL from Kenai might help, but it won’t build under Ubuntu (I presume it has a slightly different layout to Red Hat in terms of libraries) and the API appears to have changed massively anyway. It seems 32-bit is the only realistic solution. :’(

::slight_smile: Prob sol. Turns out that I have an nVidia graphics card, and Ubuntu requires you to go to an extra effort to install drivers for it. Installed the nvidia-glx-185 package and the 64-bit JOGL libraries work fine.

Only wasted a day on that. >:(