NewtCanvasAWT resize issue on OS X 10.9.2

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

NewtCanvasAWT resize issue on OS X 10.9.2

ulmangt
I'm on Mac OS X 10.9.2 with Oracle Java 1.7.0_51-b13 and JOGL 2.1.3.

I create a simple JFrame > NewtCanvasAWT > GLWindow and color the background red. When the window pops up, this works:

Window with correct behavior

However, if I resize the window, the OpenGL drawing area sticks in the lower left corner of the window:

Window after resizing

I only observe this behavior with the above setup. On the Windows or Linux machines that I have tested, the window is always entirely red.

I've searched the forums and found issues which sound similar:

http://forum.jogamp.org/Issue-with-Java-3D-under-OpenJDK-7-Mac-OS-X-td4025259i80.html
http://forum.jogamp.org/Mac-OS-X-10-7-Oracle-JRE-7-Swing-integration-issues-td4027780.html

But they're all about a year old and seem to have supposedly been fixed.

Should the code below work? Am I missing something? Or is this a bug? Any insight would be appreciated.

Here's the simple test case that I'm using:

import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.swing.JFrame;

import com.jogamp.newt.awt.NewtCanvasAWT;
import com.jogamp.newt.opengl.GLWindow;

public class Test2
{
    public static void main( String[] args )
    {
        GLProfile glp = GLProfile.getDefault( );
        GLCapabilities caps = new GLCapabilities( glp );

        GLWindow window = GLWindow.create( caps );
        NewtCanvasAWT glCanvas = new NewtCanvasAWT( window );
        JFrame frame = new JFrame( );
        
        window.addGLEventListener( new GLEventListener( )
        {
            @Override public void init( GLAutoDrawable drawable ) { }
            @Override public void dispose( GLAutoDrawable drawable ) { }
            @Override public void reshape( GLAutoDrawable drawable, int x, int y, int width, int height ) { }
            
            @Override
            public void display( GLAutoDrawable drawable )
            {
                GL gl = drawable.getContext( ).getGL( );
                gl.glClearColor( 1.0f, 0.0f, 0.0f, 1.0f );
                gl.glClear( GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT );
            }
        });

        frame.add( glCanvas );

        frame.setSize( 800, 800 );
        frame.setVisible( true );
    }
}
Reply | Threaded
Open this post in threaded view
|

Re: NewtCanvasAWT resize issue on OS X 10.9.2

jmaasing
Can not reproduce when using 2.1.5, so please upgrade your JOGL.
Reply | Threaded
Open this post in threaded view
|

Re: NewtCanvasAWT resize issue on OS X 10.9.2

gouessej
Administrator
In reply to this post by ulmangt
Please always use the very latest version before claiming that there is another bug, jmaasing is right, use JOGL 2.1.5-01.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: NewtCanvasAWT resize issue on OS X 10.9.2

ulmangt

Just tried it myself with 2.1.5-01 and verified that it is indeed fixed for me in that version.

Sorry for the false alarm and for not trying the latest version first.

Thanks for the help!
Reply | Threaded
Open this post in threaded view
|

Re: NewtCanvasAWT resize issue on OS X 10.9.2

gouessej
Administrator
Thank your for the feedback. Now we're sure it works with the latest version.
Julien Gouesse | Personal blog | Website