From 3ac0842d3a3779e94e4f70ec65b7062f60929c62 Mon Sep 17 00:00:00 2001 From: Dan Werthimer Date: Thu, 8 May 2003 22:53:52 +0000 Subject: [PATCH] no message svn path=/trunk/boinc/; revision=1168 --- api/boinc_api.h | 4 ++-- api/windows_opengl.cpp | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/api/boinc_api.h b/api/boinc_api.h index 4f9d9fabdb..479a3d4cc5 100755 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -17,8 +17,8 @@ // Contributor(s): // -#ifndef _BOINC_API -#define _BOINC_API +#ifndef _BOINC_API_ +#define _BOINC_API_ #include #ifdef HAVE_SYS_TIME_H diff --git a/api/windows_opengl.cpp b/api/windows_opengl.cpp index 8735f0054d..6a7a5a6a9c 100755 --- a/api/windows_opengl.cpp +++ b/api/windows_opengl.cpp @@ -37,11 +37,12 @@ static HDC hdc; static HGLRC hRC; -static HWND hWnd=NULL; // Holds Our Window Handle +static HWND hWnd=NULL; // Holds Our Window Handle static HINSTANCE hInstance; // Holds The Instance Of The Application -static RECT rect = {50, 50, 50+640, 50+480}; -static int current_graphics_mode = MODE_HIDE_GRAPHICS; +static RECT rect = {50, 50, 50+640, 50+480}; +static int current_graphics_mode = MODE_HIDE_GRAPHICS; static POINT mousePos; +static UINT m_uEndSSMsg; BOOL win_loop_done; @@ -64,7 +65,6 @@ void SetMode(int mode) { DWORD dwExStyle; DWORD dwStyle; - if(hWnd) { if (hRC) wglDeleteContext(hRC); if (hdc) ReleaseDC(hWnd, hdc); @@ -172,13 +172,19 @@ LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: - if(current_graphics_mode == MODE_FULLSCREEN) SetMode(MODE_HIDE_GRAPHICS); + if(current_graphics_mode == MODE_FULLSCREEN) { + SetMode(MODE_HIDE_GRAPHICS); + PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0); + } return 0; case WM_MOUSEMOVE: if(current_graphics_mode == MODE_FULLSCREEN) { POINT cPos; GetCursorPos(&cPos); - if(cPos.x != mousePos.x || cPos.y != mousePos.y) SetMode(MODE_HIDE_GRAPHICS); + if(cPos.x != mousePos.x || cPos.y != mousePos.y) { + SetMode(MODE_HIDE_GRAPHICS); + PostMessage(HWND_BROADCAST, m_uEndSSMsg, 0, 0); + } } return 0; case WM_CLOSE: @@ -220,6 +226,7 @@ DWORD WINAPI win_graphics_event_loop( LPVOID gi ) { MSG msg; // Windows Message Structure double start = (double)time(0); + m_uEndSSMsg = RegisterWindowMessage(END_SS_MSG); // Register window class and graphics mode message reg_win_class();