rem: dl->setAmbientColor( .3, .3, .3, 1 ); dl->setDiffuseColor( 1, 1, 1, 1 );
add: dl->setAmbient( .3, .3, .3, 1 ); dl->setDiffuse( 1, 1, 1, 1 );
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);		// glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );		glEnable( GL_DEPTH_TEST );	glEnable( GL_LIGHTING );	glEnable( GL_LIGHT0 );	// OSG#if defined(__linux) || ( defined(WIN32) && ! defined(OSG_BUILD_DLL) )    RAWSceneFileType *pR = &(RAWSceneFileType::staticThe());#endif    SceneFileHandler::the().print();	// 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();	DirectionalLightPtr dl = DirectionalLight::create();	beginEditCP(dlight);	dlight->setCore( dl );	endEditCP(dlight);		beginEditCP(dl);	dl->setAmbientColor( .3, .3, .3, 1 );	dl->setDiffuseColor( 1, 1, 1, 1 );	dl->setDirection(0,0,1);	dl->setBeacon( b1n);	endEditCP(dl);	// root    root = Node::create();    GroupPtr gr1 = Group::create();	beginEditCP(root);	root->setCore( gr1 );	root->addChild( t1n );	root->addChild( dlight );	endEditCP(root);	// Load the file	NodePtr file = NullNode;		if ( argc > 1 )		file = SceneFileHandler::the().read(argv[1]);		if ( file == NullNode )	{		cerr << "Couldn't load file, ignoring" << endl;		file = makeTorus( .5, 2, 16, 16 );	}		file->updateVolume();	Vec3f min,max;	file->getVolume().getBounds( min, max );		cout << "Volume: from " << min << " to " << max << endl;	beginEditCP(dlight);	dlight->addChild( file );	endEditCP(dlight);	cerr << "Tree: " << endl;	root->dump();	// Camera		cam = PerspectiveCamera::create();	cam->setBeacon( b1n );	cam->setDegrees( 90 );	cam->setNear( 0.1 );	cam->setFar( 10000 );	// Background	GradientBackgroundPtr gbkgnd = GradientBackground::create();	gbkgnd->addColor( Color3f(1, 0, 0), 0.0 );	gbkgnd->addColor( Color3f(0, 1, 0), 0.2 );	gbkgnd->addColor( Color3f(0, 0, 1), 0.3 );	gbkgnd->addColor( Color3f(0, 1, 1), 0.4 );	gbkgnd->addColor( Color3f(0, 1, 0), 0.5 );	gbkgnd->addColor( Color3f(1, 1, 0), 0.6 );	gbkgnd->addColor( Color3f(0, 1, 0), 0.7 );	gbkgnd->addColor( Color3f(1, 0, 0), 0.8 );	gbkgnd->addColor( Color3f(0, 0, 1), 0.9 );	gbkgnd->addColor( Color3f(0, 0, 1), 1.0 );	// Viewport	vp = Viewport::create();	vp->setCamera( cam );	vp->setBackground( gbkgnd );	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 );	win->init();	// Action		ract = DrawAction::create();	// tball	Vec3f pos( 0, 0, max[2] + ( max[2] - min[2] ) * 1.5 );	tball.setMode( Trackball::OSGObject );	tball.setStartPosition( pos, true );	tball.setSum( true );	tball.setTranslationMode( Trackball::OSGFree );	// run...		glutMainLoop();	    return 0;}