Some changes from John.

The main attraction seems to be correcting a bug with the action-on-
window-close.


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@446 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
rkrolib 2004-01-16 00:17:23 +00:00
parent 96d0286492
commit 5e022b0578

View File

@ -465,10 +465,10 @@ static void fgSleepForEvents( void )
int err;
int socket;
struct timeval wait;
socket = ConnectionNumber( fgDisplay.Display );
FD_ZERO( &fdset );
FD_SET( socket, &fdset );
wait.tv_sec = msec / 1000;
wait.tv_usec = (msec % 1000) * 1000;
err = select( socket+1, &fdset, NULL, NULL, &wait );
@ -596,6 +596,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
case DestroyNotify:
/*
* This is sent to confirm the XDestroyWindow call.
*
* XXX WHY is this commented out? Should we re-enable it?
*/
/* fgAddToWindowDestroyList ( window ); */
@ -1051,6 +1052,8 @@ void FGAPIENTRY glutMainLoopEvent( void )
*/
void FGAPIENTRY glutMainLoop( void )
{
int action;
#if TARGET_HOST_WIN32
SFG_Window *window = (SFG_Window *)fgStructure.Windows.First ;
#endif
@ -1111,9 +1114,12 @@ void FGAPIENTRY glutMainLoop( void )
/*
* When this loop terminates, destroy the display, state and structure
* of a freeglut session, so that another glutInit() call can happen
*
* Save the "ActionOnWindowClose" because "fgDeinitialize" resets it.
*/
action = fgState.ActionOnWindowClose;
fgDeinitialize( );
if( fgState.ActionOnWindowClose == GLUT_ACTION_EXIT )
if( action == GLUT_ACTION_EXIT )
exit( 0 );
}
@ -1224,6 +1230,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
window->State.Width = LOWORD(lParam);
window->State.Height = HIWORD(lParam);
}
break;
#if 0
case WM_SETFOCUS: