From: Sharanga D. <sh...@nt...> - 2004-08-10 20:33:15
|
Hi Is the shutdown logic for when glutmainloop terminates fully functional? Using the last example with the fullscreen mode app which used to fail, I cannot get it to shutdown and display the message "Exit link 1", which was the last line in the main function, despite having executed the glutSetOption( GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS ); Also, in the freeglut_main.c function I noticed this at line 1126: fgDeinitialize( ); A-->if( fgState.ActionOnWindowClose == GLUT_ACTION_EXIT )<--A exit( 0 ); If you look at the fgDeinitialize function at line 271 in freglut_init.c B-->fgState.ActionOnWindowClose = GLUT_ACTION_EXIT;<--B is executed, which means Line A will always test true and the app will terminate. Commenting out line B causes the terminating statement ( "Exit Link 1" )in my fullscreen test app ( attached here again for completeness ) to be displayed. However, the app GPFs instead of terminating correctly. Is this functionality not supposed to work at the moment? Cheers Sha Fay John F Contr AAC/WMG wrote: > <begin quote> > void FGAPIENTRY glutLeaveGameMode( void ) > { > freeglut_return_if_fail( fgStructure.GameMode ); > > fgStructure.GameMode->State.IsGameMode = GL_FALSE; > > fgAddToWindowDestroyList( fgStructure.GameMode ); > + fgStructure.GameMode = NULL ; > > #if TARGET_HOST_UNIX_X11 > > XUngrabPointer( fgDisplay.Display, CurrentTime ); > <end quote> > > This seems to have fixed the problem for me. Does it work for you? |