Login  Register

Context sharing: regression from JSR231 to Jogl 2.x?

Posted by TomN on Sep 13, 2011; 9:33am
URL: https://forum.jogamp.org/Context-sharing-regression-from-JSR231-to-Jogl-2-x-tp3332167.html

Has anything changed in Jogl2 regarding context sharing between different drawables? Code that I wrote against the JSR-231 builds of Jogl no longer works after upgrading to Jogl2 RC2. For instance, I would expect that after creating two GLCanvases as below, texture objects created in the first would also be valid in the second. This was the case with older versions but not with Jogl2. Do I need to adapt my code or is this a bug?

    fFrame = new JFrame();
    fFrame.getContentPane().setLayout( new GridLayout( 1, 2 ) );

    fFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

    fDrawable1 = new GLCanvas( new GLCapabilities( GLProfile.getDefault() ) );
    fDrawable1.setSize( 512, 512 );
    fFrame.getContentPane().add( fDrawable1 );

    fDrawable2 = new GLCanvas( new GLCapabilities( GLProfile.getDefault() ), fDrawable1.getContext() );
    fDrawable2.setSize( 512, 512 );
    fFrame.getContentPane().add( fDrawable2 );

    fFrame.pack();
    fFrame.setVisible( true );

Thanks,
-- Tom