rem: Image image( Image::OSG_RGBA_PF, 3, 2, 1, 1, 1, 0, imgdata );
add: Image *pImage = new Image( Image::OSG_RGBA_PF, 3, 2, 1, 1, 1, 0, imgdata );
context: int main (int argc, char **argv){    // GLUT init    osgInit(argc, argv);    glutInit(&argc, argv);    glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);    glutCreateWindow("OpenSG");    // glutKeyboardFunc(key);    // glutReshapeFunc(resize);    glutDisplayFunc(display);    // glutMouseFunc(mouse);    // glutMotionFunc(motion);    glutIdleFunc(display);    glMatrixMode( GL_PROJECTION );    glLoadIdentity();    gluPerspective( 60, 1, 0.1, 10 );    glMatrixMode( GL_MODELVIEW );    glLoadIdentity();    gluLookAt( 3, 3, 3,  0, 0, 0,   0, 0, 1 );    glEnable( GL_DEPTH_TEST );    glEnable( GL_LIGHT0 );    // OSG    plane = makePlane( 2, 2, 2, 2 );    torus = makeTorus( .2, 1, 16, 8 );    GeometryPtr plane_geo, torus_geo;    plane_geo = GeometryPtr::dcast(plane->getCore());    torus_geo = GeometryPtr::dcast(torus->getCore());    SimpleTexturedMaterialPtr pm, tm;    pm = SimpleTexturedMaterial::create();    beginEditCP(pm);    pm->setDiffuse( Color3f( 1,0,0 ) );    pm->setAmbient( Color3f( 1,0,0 ) );    pm->setSpecular( Color3f( 1,1,1 ) );    pm->setShininess( 10 );    UChar8 imgdata[] =        {  255,0,0,128,  255,0,0,255,  255,0,255,0,           255,0,0,128,  255,0,0,255,  255,0,255,0 };    Image image( Image::OSG_RGBA_PF, 3, 2, 1, 1, 1, 0, imgdata );    pm->setImage( &image ); // NOTE: the image is NOT copied, the variable                            // needs to be kept around as long as the texture                            // is used    pm->setMagFilter( GL_NEAREST );    endEditCP(pm);    plane_geo->setMaterial( pm );    tm = SimpleTexturedMaterial::create();    beginEditCP(tm);    tm->setDiffuse( Color3f( 0,1,0 ) );    tm->setAmbient( Color3f( 0,1,0 ) );    UChar8 imgdata2[] =        {  255,0,0,  255,0,0,  255,0,255,           255,0,0,  255,0,0,  255,0,255 };    Image image2( Image::OSG_RGB_PF, 3, 2, 1, 1, 1, 0, imgdata2 );    tm->setImage( &image2 );    tm->setEnvMode( GL_REPLACE );    tm->setEnvMap( true );    endEditCP(tm);    torus_geo->setMaterial( tm );    //    // The action    win = GLUTWindow::create();    dact = DrawAction::create();    dact->setWindow( win.getCPtr() );    glutMainLoop();    return 0;}