X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_main.c;h=e45ee4deab0ca241fe75fae18720d4fde5d74396;hb=48c513d508f6836e1fcbaa68ac2e0f2f9a486852;hp=72ef45dc45fd7da85e4b52440e4225e9f345319e;hpb=71ec11ce7f27a289e3644ecd9a13784eb6f490c9;p=freeglut diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 72ef45d..e45ee4d 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -572,8 +572,9 @@ void FGAPIENTRY glutMainLoopEvent( void ) fgDeinitialize( ); exit( 0 ); } + else if( fgState.ActionOnWindowClose == GLUT_ACTION_GLUTMAINLOOP_RETURNS ) + fgState.ExecState = GLUT_EXEC_STATE_STOP; - fgState.ExecState = GLUT_EXEC_STATE_STOP; return; } break; @@ -1086,7 +1087,9 @@ void FGAPIENTRY glutMainLoopEvent( void ) fgDeinitialize( ); exit( 0 ); } - fgState.ExecState = GLUT_EXEC_STATE_STOP; + else if( fgState.ActionOnWindowClose == GLUT_ACTION_GLUTMAINLOOP_RETURNS ) + fgState.ExecState = GLUT_EXEC_STATE_STOP; + return; } @@ -1318,7 +1321,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, break; #if 0 case WM_SETFOCUS: - printf("WM_SETFOCUS: %p\n", window ); + /* printf("WM_SETFOCUS: %p\n", window ); */ lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); break; @@ -1326,8 +1329,8 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, if (LOWORD(wParam) != WA_INACTIVE) { /* glutSetCursor( fgStructure.Window->State.Cursor ); */ - printf("WM_ACTIVATE: glutSetCursor( %p, %d)\n", window, - window->State.Cursor ); + /* printf("WM_ACTIVATE: glutSetCursor( %p, %d)\n", window, + window->State.Cursor ); */ glutSetCursor( window->State.Cursor ); } @@ -1894,11 +1897,15 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, { /* * We have received a system command message. Try to act on it. - * The commands are passed in through the "lParam" parameter: - * Clicking on a corner to resize the window gives a "F004" message - * but this is not defined in my header file. + * The commands are passed in through the "wParam" parameter: + * The least significant digit seems to be which edge of the window + * is being used for a resize event: + * 4 3 5 + * 1 2 + * 7 6 8 + * Congratulations and thanks to Richard Rauch for figuring this out.. */ - switch ( lParam ) + switch ( wParam & 0xfff0 ) { case SC_SIZE : break ; @@ -1952,6 +1959,12 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, case SC_HOTKEY : break ; + + default: +#if _DEBUG + fgWarning( "Unknown wParam type 0x%x\n", wParam ); +#endif + break; } } #endif /* !TARGET_HOST_WINCE */