I have a smal problem. I making aplication in to the CAVE. There is more than one display. I can make glut aplication that is in one display. But now I try to create aplikaction in to 2 display. I try this with putenv. But both of this windows are in first one. I think that is caused by glutInit. Firstly I call putenv(“DISPLAY=:0.1”); which make first window on first display, but I supposed that putenv(“DISPLAY=:0.0”) make second window in to second display but it isnt . It is still in first display. I think that after I call glutinit, program will save display and all of other windows display here. But glutinit i call just once. So can anybody help me with this problem please ?
putenv("DISPLAY=:0.1"); //display 1 glutInit(&argc, argv); //glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STEREO); //stereo vizual //glutInitWindowPosition(5, 5); //glutInitWindowSize(WIDTH, HEIGHT); glutInitWindowPosition(5, 5); glutInitWindowSize(600, 450); // window0 /* Create main window and set callbacks. */ int id_w1 = glutCreateWindow("vokno1"); this->win = id_w1; windows = id_w1; active_windows = true; glutDisplayFunc(myDisplay); glutReshapeFunc(myReshape); glutIdleFunc(myIdle); /* Create main menu. */ glutCreateMenu(myMenu); glutAddMenuEntry("Quit", 99); /* Menu will be invoked by the right mouse button */ glutAttachMenu(GLUT_RIGHT_BUTTON); init(); //wokno 2---- glutInitWindowPosition(200, 5); glutInitWindowSize(600, 450); putenv("DISPLAY=:0.0"); //display 0 int id_w2 = glutCreateWindow("vokno2"); //this->win = id_w2; windows = id_w2; active_windows = true; glutDisplayFunc(myDisplay); glutReshapeFunc(myReshape); //glutIdleFunc(myIdle); //glutCreateMenu(myMenu); //glutAddMenuEntry("Quit w2", 1); //glutAddMenuEntry("hide w2", 7); //glutAddMenuEntry("show w2", 8); init(); /* Run endless main loop to process events. */ glutMainLoop();
PS sorry for mistake my english is quite bad