Depth Buffer not working in Linux using b07

Since the new fix in b07, I’m now able to run my JOGL app on my linux machine (running Fedora Core 2) it all runs peachy except for one problem I’ve noticed. The objects are not drawn in correct depth order even though I have enabled the GL_DEPTH_TEST. When I try the code on Windows and OS X I have no problems at all. I’ve written some simple source code to demonstrate the error.


import net.java.games.jogl.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;


class Main
{
      public static void main(String [] args)
      {
            JFrame frame=new JFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            GLPanel panel=new GLPanel();
            frame.getContentPane().add(panel);
            frame.pack();
            frame.setVisible(true);
            panel.showCanvas();
      }
}

class GLPanel extends JPanel implements GLEventListener
{
      private GLCanvas canvas;
      private GLCapabilities capabilities;
      //Constructor: Initializes a JOGL canvas with Hardware Acceleration and Dubble Buffering enabled
      public GLPanel()
      {
                   capabilities=new GLCapabilities();
              capabilities.setHardwareAccelerated(false);
              capabilities.setDoubleBuffered(false);
              canvas=GLDrawableFactory.getFactory().createGLCanvas(capabilities);
              canvas.addGLEventListener(this);
              add(canvas);
              setPreferredSize(new Dimension(300,200));
              canvas.setVisible(false);
      }
      public void repaintCanvas()
      {
            canvas.display();
      }
      public void showCanvas()
      {
            canvas.setSize(getSize().width, getSize().height);
            canvas.setVisible(true);
      }
      //init:  Initializes the canvas by setting the viewport, lighting, etc.
      public void init(GLDrawable glDrawable)
      {
            GL myGL=glDrawable.getGL();
            GLU myGLU=glDrawable.getGLU();
            int w=canvas.getSize().width, h=canvas.getSize().height;
            myGL.glEnable(GL.GL_DEPTH_TEST);
            myGL.glMatrixMode(GL.GL_PROJECTION);
            myGL.glLoadIdentity();
            myGLU.gluPerspective(45.0,w/(double)h,0.01,300);
      }
      public void drawDisk(GLDrawable glDrawable, double x, double y, double z, int rad, Point prec)
      {
            GL myGL=glDrawable.getGL();
            GLU myGLU=glDrawable.getGLU();
            GLUquadric sphere;
            myGL.glPushMatrix();
                  sphere=myGLU.gluNewQuadric();
                  myGLU.gluQuadricOrientation(sphere, GLU.GLU_OUTSIDE);
                  myGL.glTranslatef((float)x, (float)y, (float)z);
                  myGLU.gluDisk(sphere, rad, 0, prec.x, prec.y);
            myGLU.gluDeleteQuadric(sphere);
            myGL.glPopMatrix();
      }
      public void display(GLDrawable glDrawable)
      {
            GL myGL=glDrawable.getGL();
            GLU myGLU=glDrawable.getGLU();
        myGL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
          myGL.glMatrixMode(GL.GL_MODELVIEW);
        myGL.glLoadIdentity();
            myGLU.gluLookAt(0,0, 100,
                        0,0, 0,
                        0, 1, 0);
            /*The disks are called in the order(Farthest from camera to nearest):
             *Red, Green, Blue, White, Magenta
             *But using the depth buffer they should appear(Farthest from camera to nearest):
             *Magenta, Green, White, Red, Blue
             */
            myGL.glColor3f(1.0f, 0.0f, 0.0f);
            drawDisk(glDrawable, 0,0,3,10,new Point(15,15));
            myGL.glColor3f(0.0f, 1.0f, 0.0f);
            drawDisk(glDrawable, 8,8,1,10,new Point(15,15));
            myGL.glColor3f(0.0f, 0.0f, 1.0f);
            drawDisk(glDrawable, -8,8,4,10,new Point(15,15));
            myGL.glColor3f(1.0f, 1.0f, 1.0f);
            drawDisk(glDrawable, 8,-8,2,10,new Point(15,15));
            myGL.glColor3f(1.0f, 0.0f, 1.0f);
            drawDisk(glDrawable, -8,-8,0,10,new Point(15,15));
            myGL.glFlush();
      }
      public void reshape(GLDrawable glDrawable, int i, int i1, int width, int height)
      {
            GL myGL = glDrawable.getGL();
            GLU myGLU = glDrawable.getGLU();
            int w=canvas.getSize().width, h=canvas.getSize().height;
            myGL.glViewport(0, 0, w, h);
            myGL.glMatrixMode(GL.GL_PROJECTION);
            myGL.glLoadIdentity();
            myGLU.gluPerspective(45.0,w/(double)h,0.01,300);
      }
      public void displayChanged(GLDrawable glDrawable, boolean b, boolean b1)
      {
      }
}

The code should draw the disks in the order: Magenta, Green, White, Red, Blue, but when I run it on Windows that’s what happens, but in Linux Red is on top. Ken tried this on his but it worked fine…any ideas?