X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_window.c;h=f3c509a5023d29d5d6572682b2bef6e1372b7c1d;hb=123cc1d42bff9bdda4cc5a1b621d51b019814257;hp=0c56fe1135cdc8db03b16013359145a3aee17153;hpb=ded8742fba5a4622b49778679cc7e26d197d75c5;p=freeglut diff --git a/src/freeglut_window.c b/src/freeglut_window.c index 0c56fe1..f3c509a 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -141,6 +141,10 @@ typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShar #endif /* TARGET_HOST_MS_WINDOWS */ +#ifdef WM_TOUCH + typedef BOOL (WINAPI *pRegisterTouchWindow)(HWND,ULONG); + static pRegisterTouchWindow fghRegisterTouchWindow = (pRegisterTouchWindow)0xDEADBEEF; +#endif /* pushing attribute/value pairs into an array */ #define ATTRIB(a) attributes[where++]=(a) @@ -1293,7 +1297,10 @@ void fgOpenWindow( SFG_Window* window, const char* title, /* Enable multitouch: additional flag TWF_FINETOUCH, TWF_WANTPALM */ #ifdef WM_TOUCH - RegisterTouchWindow( window->Window.Handle, TWF_FINETOUCH | TWF_WANTPALM ); + if (fghRegisterTouchWindow == (pRegisterTouchWindow)0xDEADBEEF) + fghRegisterTouchWindow = (pRegisterTouchWindow)GetProcAddress(GetModuleHandle("user32"),"RegisterTouchWindow"); + if (fghRegisterTouchWindow) + fghRegisterTouchWindow( window->Window.Handle, TWF_FINETOUCH | TWF_WANTPALM ); #endif #if defined(_WIN32_WCE) @@ -1325,10 +1332,11 @@ void fgOpenWindow( SFG_Window* window, const char* title, */ void fgCloseWindow( SFG_Window* window ) { - /* if we're in gamemode, call glutLeaveGameMode first to make sure the - * gamemode is properly closed before closing the window + /* if we're in gamemode and we're closing the gamemode window, + * call glutLeaveGameMode first to make sure the gamemode is + * properly closed before closing the window */ - if (fgStructure.GameModeWindow != NULL) + if (fgStructure.GameModeWindow != NULL && fgStructure.GameModeWindow->ID==window->ID) glutLeaveGameMode(); #if TARGET_HOST_POSIX_X11