Bug 58

Summary: GLCanvas draws over other components in MacOS X
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: VERIFIED WORKSFORME    
Severity: normal    
Priority: P1    
Version: 1   
Hardware: All   
OS: macosx   
Type: DEFECT SCM Refs:
Workaround: ---
Attachments: Test program that demonstrates the issue. Run under MacOS X.

Description Sven Gothel 2010-03-24 07:46:10 CET


---- Reported by daw 2004-01-17 22:28:27 ----

When adding multiple panels into a frame where components do not overlap, the 
GLCanvas occupies the entire frame, drawing over the other panels under Mac OS X.  The 
problem does not appear to exist under Linux.  An example is included below.  On MacOS 
X (10.2.8), the buttonPanel is not visible, however, under Linux, the buttonPanel is visible.

------- Test Program --------

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

public class TestProgram {
  
  private static class Renderer implements GLEventListener {
    
    public void display( GLDrawable drawable ) {
      GL gl = drawable.getGL();
      gl.glClear(GL.GL_COLOR_BUFFER_BIT);
      gl.glMatrixMode(GL.GL_MODELVIEW);
      gl.glLoadIdentity();
      gl.glBegin( GL.GL_TRIANGLES );
      gl.glVertex2d(-1.0, -1.0 );
      gl.glVertex2d(1.0, -1.0);
      gl.glVertex2d(0.0, 1.0);
      gl.glEnd();
      gl.glFlush();
    }
    
    public void displayChanged(GLDrawable drawable, boolean modeChanged, 
                             boolean deviceChanged) { }
    
    public void init(GLDrawable drawable) {}
    
    public void reshape( GLDrawable drawable, int x, int y, int w, int h){
      GL gl = drawable.getGL();
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glLoadIdentity();
      gl.glOrtho(-2.0, 2.0, -2.0, 2.0, -1, 1 );
    }
  }
  
  public static void main( String[] args ) {
    JFrame frame = new JFrame();
    JPanel mainPanel = new JPanel();
    mainPanel.setLayout( new BorderLayout() );
    Renderer rend = new Renderer();
    GLCanvas can = GLDrawableFactory.getFactory().createGLCanvas(new 
GLCapabilities());
    can.addGLEventListener( rend );
    
    mainPanel.add(can, BorderLayout.CENTER );
    JPanel buttonPanel = new JPanel();
    buttonPanel.add( new JButton("Button One") );
    buttonPanel.add( new JButton("Button Two") );
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    
    frame.getContentPane().add(mainPanel);
    frame.setSize( 400,400);
    frame.show();
  }
  
}



---- Additional Comments From daw 2004-01-17 22:30:02 ----

Created an attachment
Test program that demonstrates the issue.  Run under MacOS X.




---- Additional Comments From gziemski 2004-01-18 10:01:34 ----

This is working for me.

You need to either get the 1.4.2 DP2 (or the final when it is released), or install Java3D on top of 
JDK1.4.1. Java3D comes with updated libjawt.dylib which is where the problem was.



--- Bug imported by sgothel@jausoft.com 2010-03-24 07:46 EDT  ---

This bug was previously known as _bug_ 58 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=58
Imported an attachment (id=16)

The original submitter of attachment 16 [details] is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.