From 796fdd51d97285b392873a46d000519e9068bb45 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 28 Jul 2008 02:09:44 +0000 Subject: [PATCH] - API: small additions to graphics stderr messages svn path=/trunk/boinc/; revision=15693 --- api/graphics2.h | 2 +- api/graphics2_win.C | 16 ++++++++-------- checkin_notes | 7 +++++++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/api/graphics2.h b/api/graphics2.h index ad6b233023..5d5ebc2d79 100644 --- a/api/graphics2.h +++ b/api/graphics2.h @@ -17,7 +17,7 @@ extern void boinc_graphics_loop(int, char**); extern void* boinc_graphics_make_shmem(char*, int); extern void* boinc_graphics_get_shmem(char*); extern void boinc_set_windows_icon(const char* icon16,const char* icon48); -extern void boinc_close_window_and_quit(); +extern void boinc_close_window_and_quit(const char*); // Implementation stuff // diff --git a/api/graphics2_win.C b/api/graphics2_win.C index bab4d01853..c520c70486 100644 --- a/api/graphics2_win.C +++ b/api/graphics2_win.C @@ -39,8 +39,8 @@ static bool window_ready=false; static UINT_PTR gfx_timer_id = 0; static bool fullscreen; -void boinc_close_window_and_quit() { - //fprintf(stderr, "Close event detected, shutting down.\n"); +void boinc_close_window_and_quit(const char* p) { + fprintf(stderr, "Close event (%s) detected, shutting down.\n", p); window_ready=false; wglMakeCurrent(NULL,NULL); // release GL rendering context @@ -205,7 +205,7 @@ LRESULT CALLBACK WndProc( case WM_KEYDOWN: if(!window_ready) return 0; if (fullscreen) { - boinc_close_window_and_quit(); + boinc_close_window_and_quit("key down"); } else { boinc_app_key_press((int)wParam, (int)lParam); } @@ -213,7 +213,7 @@ LRESULT CALLBACK WndProc( case WM_KEYUP: if(!window_ready) return 0; if (fullscreen) { - boinc_close_window_and_quit(); + boinc_close_window_and_quit("key up"); } else { boinc_app_key_release((int)wParam, (int)lParam); } @@ -227,7 +227,7 @@ LRESULT CALLBACK WndProc( if(!window_ready) return 0; if (fullscreen) { - boinc_close_window_and_quit(); + boinc_close_window_and_quit("button up"); } else { int which; bool down; @@ -243,7 +243,7 @@ LRESULT CALLBACK WndProc( GetCursorPos(&cPos); if (fullscreen) { if(cPos.x != mousePos.x || cPos.y != mousePos.y) { - boinc_close_window_and_quit(); + boinc_close_window_and_quit("mouse move"); } } else { boinc_app_mouse_move( @@ -255,10 +255,10 @@ LRESULT CALLBACK WndProc( } return 0; case WM_CLOSE: - boinc_close_window_and_quit(); + boinc_close_window_and_quit("WM_CLOSE"); return 0; case WM_SHUTDOWNGFX: - boinc_close_window_and_quit(); + boinc_close_window_and_quit("WM_SHUTDOWNGFX"); return 0; case WM_DESTROY: PostQuitMessage(0); diff --git a/checkin_notes b/checkin_notes index 61895bb9f3..26f1e30496 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5984,3 +5984,10 @@ David 25 July 2008 html/user/ forum_moderate_thread_action.php + +David 27 July 2008 + - API: small additions to graphics stderr messages + + api/ + graphics2.h + graphics2_win.C