<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>24</bug_id>
          
          <creation_ts>2003-07-11 01:21:17 +0200</creation_ts>
          <short_desc>GLCanvas does not honor layout</short_desc>
          <delta_ts>2010-03-24 07:45:35 +0100</delta_ts>
          <reporter_accessible>0</reporter_accessible>
          <cclist_accessible>0</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>macosx</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>40</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:45:35 +0100</bug_when>
    <thetext>


---- Reported by chadseld 2003-07-11 13:21:17 ----

A GLCanvas occupies all the space in a Frame/JFrame. There is no way to place a GLCanvas 
inside or next to a Panel/JPanel and keep it in a specific area of a Frame. The GLCanvas will 
always display itself over the entire Frame. The following pseudo code example works with 
gl4java, and (I&apos;m told) with jogl for Windows, but in broken in jogl for Mac OS X.

public class Panels implements GLEventListener
{
    private Frame frame;
    private JPanel panel = new JPanel();
    private JLabel label = new JLabel(&quot;foo&quot;);
    private GLCanvas canvas;
    
    public static void main(String[] args)
    {
        Panels app = new Panels();
    }
    
    
    public Panels()
    {
        try
        {
            // Create GL Canvas
            canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
            canvas.addGLEventListener(this);
            
            // Frame
            frame = new Frame(&quot;Simple Test World&quot;);
            frame.setSize(1024,1024);
            panel.setPreferredSize(new Dimension(64, 400));
            frame.add(canvas, BorderLayout.CENTER);
            frame.add(panel, BorderLayout.EAST);
            frame.add(label, BorderLayout.SOUTH);
            frame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
                }
            });            
            frame.show();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }
    
    
    public void init(GLDrawable drawable)
    {
        GLFunc gl = drawable.getGL();
        
        // This Will Clear The Background Color To light blue
        gl.glClearColor(0.8f, 0.8f, 0.99f, 0.0f);
        gl.glClearDepth(1.0);
        
        // Misc
        ...
        
        // Set up the viewport
        gl.glViewport(0,0, 10,10);// Toying with these bounds doesn&apos;t change anything
                                                
        
        // Prep for first draw
        gl.glMatrixMode(GLEnum.GL_MODELVIEW);
        gl.glLoadIdentity();
        gl.glClear(GLEnum.GL_DEPTH_BUFFER_BIT);
    }
    
    public void reshape(GLDrawable drawable, int x, int y, int width, int height)
    {
        ...
    }

    public void display(GLDrawable drawable)
    {
        GLFunc gl = drawable.getGL();
        GLUFunc glu = drawable.getGLU();
        
        //Clear The Screen And The Depth Buffer
        gl.glClear(GLEnum.GL_COLOR_BUFFER_BIT | GLEnum.GL_DEPTH_BUFFER_BIT);
    }
}


The entire frame will be drawn a pleasant light blue.



---- Additional Comments From kbr 2003-07-14 22:54:31 ----

There&apos;s no difference at the AWT level between the GLCanvas on Mac OS X and the
GLCanvas on any other platform. It would be great if you could submit another
test case showing what the output should look like. Currently I&apos;m not succeeding
in getting this test to run with a GLJPanel replacing the GLCanvas.




---- Additional Comments From kbr 2003-11-05 10:44:13 ----

The submitter has indicated that this issue has been fixed with the latest
version of Java on Mac OS X.




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

This bug was previously known as _bug_ 24 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=24
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>