[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47765] branches/soc-2012-swiss_cheese/ intern/ghost/intern: * MSVC and MinGW-w64 should work at the same level as MinGW now.
Nicholas Rishel
rishel.nick at gmail.com
Tue Jun 12 01:03:09 CEST 2012
Revision: 47765
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47765
Author: nicholas_rishel
Date: 2012-06-11 23:03:08 +0000 (Mon, 11 Jun 2012)
Log Message:
-----------
* MSVC and MinGW-w64 should work at the same level as MinGW now.
* Eeek, fixed the code that dealt with figuring out what type of touch occurred.
Modified Paths:
--------------
branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.cpp
branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.h
Modified: branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.cpp
===================================================================
--- branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.cpp 2012-06-11 22:58:49 UTC (rev 47764)
+++ branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.cpp 2012-06-11 23:03:08 UTC (rev 47765)
@@ -132,14 +132,16 @@
#endif // VK_MEDIA_PLAY_PAUSE
// Corrects MinGW defines
-#ifdef TOUCHEVENTF_DOWN
-# undef TOUCHEVENTF_DOWN
-# define TOUCHEVENTF_DOWN 0x0002
-#endif //TOUCHEVENTF_DOWN
-#ifdef TOUCHEVENTF_MOVE
-# undef TOUCHEVENTF_MOVE
-# define TOUCHEVENTF_MOVE 0x0001
-#endif //TOUCHEVENTF_UP
+#ifdef FREE_WINDOWS
+# ifdef TOUCHEVENTF_DOWN
+# undef TOUCHEVENTF_DOWN
+# define TOUCHEVENTF_DOWN 0x0002
+# endif // TOUCHEVENTF_DOWN
+# ifdef TOUCHEVENTF_MOVE
+# undef TOUCHEVENTF_MOVE
+# define TOUCHEVENTF_MOVE 0x0001
+# endif // TOUCHEVENTF_UP
+#endif // FREE_WINDOWS
static void initRawInput()
{
@@ -897,32 +899,32 @@
#endif // WITH_INPUT_NDOF
#ifdef WITH_INPUT_TOUCH
-void GHOST_SystemWin32::processTouch(UINT msg, WPARAM wParam, LPARAM lParam)
+void GHOST_SystemWin32::processTouch(WPARAM wParam, LPARAM lParam)
{
UINT cInputs = LOWORD(wParam);
PTOUCHINPUT pInputs = new TOUCHINPUT[cInputs];
GHOST_TTouchState state;
if (NULL != pInputs) {
+# if defined(_MSC_VER) || defined(FREE_WINDOWS64) // MSVC or MinGW-w64 defines
+ if (GetTouchInputInfo((HTOUCHINPUT)lParam, cInputs, pInputs, sizeof(TOUCHINPUT))) {
+# else // MinGW defines
if (GetTouchInputInfo((HANDLE)lParam, cInputs, pInputs, sizeof(TOUCHINPUT))) {
+# endif
for (UINT i = 0; i < cInputs; i++) {
-
- switch (msg) {
- case TOUCHEVENTF_DOWN:
+ if (pInputs[i].dwFlags & TOUCHEVENTF_DOWN) {
state = GHOST_kDown;
- break;
- case TOUCHEVENTF_MOVE:
+ }
+ else if (pInputs[i].dwFlags & TOUCHEVENTF_MOVE) {
state = GHOST_kMove;
- break;
- case TOUCHEVENTF_UP:
- state = GHOST_kUp;
- break;
- default:
- break;
}
+ else if (pInputs[i].dwFlags & TOUCHEVENTF_UP) {
+ state = GHOST_kUp;
+ }
- // Windows returns first ID as 2, then 3, 4... set to begin at 1
- m_touchManager->sendTouchEvent((GHOST_TUns8) pInputs[i-1].dwID, state, (GHOST_TInt32) pInputs[i].x,
+ // Windows returns first ID as 2, then 3, 4... subtract 1 to begin at 1
+ // Otherwise, Windows system touch functions as described in Pixar's Proton Chi
+ m_touchManager->sendTouchEvent((GHOST_TUns8) (pInputs[i].dwID - 1), state, (GHOST_TInt32) pInputs[i].x,
(GHOST_TInt32) pInputs[i].y, (GHOST_TUns64) getMilliSeconds());
} //end for(display touch)
@@ -1044,6 +1046,7 @@
// Touch events, processed
////////////////////////////////////////////////////////////////////////
#ifdef WITH_INPUT_TOUCH
+
# if defined(_MSC_VER) || defined(FREE_WINDOWS64) // MSVC or MinGW-w64 defines
case WM_TOUCH:
# else // MinGW defines
@@ -1051,9 +1054,17 @@
case WM_TOUCHMOVE:
case WM_TOUCHUP:
# endif
- system->processTouch(msg, wParam, lParam);
+ system->processTouch(wParam, lParam);
+
+# if defined(_MSC_VER) || defined(FREE_WINDOWS64) // MSVC or MinGW-w64 defines
+ CloseTouchInputHandle((HTOUCHINPUT) lParam);
+# else // MinGW defines
+ CloseTouchInputHandle((HANDLE) lParam);
+# endif
+
eventHandled = true;
break;
+
#endif
////////////////////////////////////////////////////////////////////////
// Mouse events, processed
Modified: branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.h 2012-06-11 22:58:49 UTC (rev 47764)
+++ branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.h 2012-06-11 23:03:08 UTC (rev 47765)
@@ -354,7 +354,7 @@
/**
* Handles Touch events, communicates directly with GHOST_TouchManager.
*/
- void processTouch(UINT msg, WPARAM wParam, LPARAM lParam);
+ void processTouch(WPARAM wParam, LPARAM lParam);
#endif
/**
More information about the Bf-blender-cvs
mailing list