public class OneTriangleSWTAWTBridge {
public static void main( String [] args ) {
GLProfile glprofile = GLProfile.getDefault();
GLCapabilities glcapabilities = new GLCapabilities( glprofile );
final GLCanvas glcanvas = new GLCanvas( glcapabilities );
Display display = new Display();
final Shell shell = new Shell( display );
shell.setText( "OneTriangle SWT AWT Bridge" );
shell.setLayout( new FillLayout() );
shell.setSize( 640, 480 );
final Composite composite = new Composite( shell, SWT.EMBEDDED );
composite.setLayout( new FillLayout() );
Frame frame = SWT_AWT.new_Frame( composite );
frame.add( glcanvas );
glcanvas.addGLEventListener( new GLEventListener() {
@Override
public void reshape( GLAutoDrawable glautodrawable, int x, int y, int width, int height ) {
OneTriangle.setup( glautodrawable.getGL().getGL2(), width, height );
}