rem: gwin->setWinID(winid);
add: gwin->setId(winid);
context: int main (int argc, char **argv){	osgInit(argc,argv);	// GLUT init	glutInit(&argc, argv);	glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);	int winid = glutCreateWindow("OpenSG");	glutKeyboardFunc(key);	glutVisibilityFunc(vis);	glutReshapeFunc(reshape);	glutDisplayFunc(display);       	glutMouseFunc(mouse);   	glutMotionFunc(motion); 		glutIdleFunc(display);	    glEnable( GL_NORMALIZE );    glEnable( GL_DEPTH_TEST );	// OSG	// create the graph	// beacon for camera and light	    NodePtr b1n = Node::create();    GroupPtr b1 = Group::create();	beginEditCP(b1n);	b1n->setCore( b1 );	endEditCP(b1n);	// transformation    NodePtr t1n = Node::create();    TransformPtr t1 = Transform::create();	beginEditCP(t1n);	t1n->setCore( t1 );	t1n->addChild( b1n );	endEditCP(t1n);	cam_trans = t1;	// light		NodePtr dlight = Node::create();	headlight = DirectionalLight::create();	beginEditCP(dlight);	dlight->setCore( headlight );	endEditCP(dlight);		beginEditCP(headlight);	headlight->setAmbient( .3, .3, .3, 1 );	headlight->setDiffuse( 1, 1, 1, 1 );	headlight->setSpecular( 1, 1, 1, 1 );	headlight->setDirection(0,0,1);	headlight->setBeacon( b1n);	endEditCP(headlight);	// root    root = Node::create();    GroupPtr gr1 = Group::create();	beginEditCP(root);	root->setCore( gr1 );	root->addChild( t1n );	root->addChild( dlight );	endEditCP(root);	// Create the scene    NodePtr sroot = Node::create(); 	beginEditCP(dlight);    dlight->addChild(sroot);   	endEditCP(dlight);    GroupPtr gr = Group::create();    beginEditCP(sroot);    sroot->setCore(gr);    endEditCP(sroot);    // a transform to move it around     NodePtr tnode = Node::create();    tr = Transform::create();    beginEditCP(tnode);    tnode->setCore( tr );    endEditCP(tnode);    beginEditCP(sroot);    sroot->addChild(tnode);    endEditCP(sroot);    // the billboard     NodePtr bnode = Node::create();    bill = Billboard::create();    beginEditCP(bnode);    bnode->setCore( bill );    endEditCP(bnode);    beginEditCP(tnode);    tnode->addChild(bnode);    endEditCP(tnode);      // a geometry to billboard    NodePtr geo = makeTorus( .2, 1, 16, 16);    beginEditCP(bnode);    bnode->addChild( geo );    endEditCP(bnode);     // a geometry to lead the render action somewhere else    geo = makePlane( 2, 2, 2, 2 );    beginEditCP(sroot);    sroot->addChild( geo );    endEditCP(sroot);    dlight->updateVolume();            Vec3f min,max;    dlight->getVolume().getBounds( min, max );	    cout << "Volume: from " << min << " to " << max << endl;    //cerr << "Tree: " << endl;    //root->dump();	// Camera	PerspectiveCameraPtr cam = PerspectiveCamera::create();	cam->setBeacon( b1n );	cam->setFov( deg2rad( 60 ) );	cam->setNear( .1 );	cam->setFar( 10. );	// Background	GradientBackgroundPtr bkgnd = GradientBackground::create();		bkgnd->addColor( Color3f( 0,0,0 ), 0 );	bkgnd->addColor( Color3f( .5,.5,0 ), 0.5 );	bkgnd->addColor( Color3f( .7,.7,1 ), 0.5 );	bkgnd->addColor( Color3f( 0,0,1 ), 1 );	// Viewport	ViewportPtr vp = Viewport::create();	vp->setCamera( cam );	vp->setBackground( bkgnd );	vp->setRoot( root );	vp->setSize( 0,0, 1,1 );	// Window	cout << "GLUT winid: " << winid << endl;	GLUTWindowPtr gwin;	GLint glvp[4];	glGetIntegerv( GL_VIEWPORT, glvp );	gwin = GLUTWindow::create();	gwin->setWinID(winid);	gwin->setSize( glvp[2], glvp[3] );	win = gwin;	win->addPort( vp );	// Actions		dact = DrawAction::create();	ract = RenderAction::create();	// tball	Vec3f pos(0,              0,              max[2] + 1.5 * (max[2] - min[2]));	tball.setMode( Trackball::OSGObject );	tball.setStartPosition( pos, true );	tball.setSum( true );	tball.setTranslationMode( Trackball::OSGFree );    tball.setTranslationScale(10.);	// run...		glutMainLoop();	    return 0;}