PDA

View Full Version : glutCreateWindow is flunking on the second window



Keith
05-28-2001, 10:27 AM
If I call glutCreateWindow a second time (with a different window_id) the program crashes (quits) the instant I run it. This is glut 3.7 on WinNT.

Any ideas?

bsperlin
05-29-2001, 09:02 AM
Here is some code I used to make 2 windows so I could use 2 screens:


glutInitWindowSize( 1024, 768 ); // P. 581 WIDTH & HEIGHT, MAY BE OVERRIDDEN
// DEFAULTS TO ? IF SKIPPED
glutInitWindowPosition( 1, 1 ); // P.581 UPPER-LEFT WINDOW CORNER FROM
// SCREEN UP-LEFT DEFAULTS TO UPPER-LEFT IF SKIPPED
Left = glutCreateWindow( "STEREO LEFT" ); // P. 581 OPENS WINDOW WITH PARAMETER
// ...NAME IN TITLE BAR BUT WINDOW IS NOT DISPLAYED UNTIL MAINLOOP
init();
glutDisplayFunc( display ); // P. 581 IDENTIFIES CALLBACK FOR ANY REDRAWING
glutReshapeFunc( reshape );//P. 582 IDENTIFIES CALLBACK FOR RESIZING & MOVING
glutMouseFunc( mouse ); // P. 582 MOUSE BUTTONS AND SCREEN POSITION
glutMotionFunc( motion );
glutKeyboardFunc( keyboard );

glutInitWindowSize( 1024, 768 ); // P. 581 WIDTH & HEIGHT, MAY BE OVERRIDDEN
// DEFAULTS TO ? IF SKIPPED
glutInitWindowPosition( 1025, 1 ); // P.581 UPPER-LEFT WINDOW CORNER FROM
// SCREEN UP-LEFT DEFAULTS TO UPPER-LEFT IF SKIPPED
Right = glutCreateWindow( "STEREO RIGHT" ); // P. 581 OPENS WINDOW WITH PARAMETER
init();
glutDisplayFunc( display ); // P. 581 IDENTIFIES CALLBACK FOR ANY REDRAWING
glutReshapeFunc( reshape );//P. 582 IDENTIFIES CALLBACK FOR RESIZING & MOVING
glutMouseFunc( mouse ); // P. 582 MOUSE BUTTONS AND SCREEN POSITION
glutMotionFunc( motion );
glutKeyboardFunc( keyboard );