windows ndof support
authorJean-Luc Peurière <jlp@nerim.net>
Thu, 2 Aug 2007 20:45:55 +0000 (20:45 +0000)
committerJean-Luc Peurière <jlp@nerim.net>
Thu, 2 Aug 2007 20:45:55 +0000 (20:45 +0000)
added by Ettore Pasquini

intern/ghost/GHOST_Types.h
intern/ghost/intern/GHOST_SystemWin32.cpp

index 379b3323f53c0fe9db074a459942e16fc70c8926..7b791c44fd852e5d0acd780a1d802bf983d30704 100644 (file)
@@ -40,7 +40,8 @@ typedef       int                                     GHOST_TInt32;
 typedef        unsigned int            GHOST_TUns32;
 
 #ifdef WIN32
-#define WM_BLND_3DX                    WM_USER + 1
+#define WM_BLND_NDOF_AXIS      WM_USER + 1
+#define WM_BLND_NDOF_BTN       WM_USER + 2
 #endif
 
 #if defined(WIN32) && !defined(FREE_WINDOWS)
index 89a9698711304493ff74d6d902e9662ff14a3f52..5f4bfe9d668323bcc727e80a334886f088020372 100644 (file)
@@ -843,7 +843,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                         * In GHOST, we let DefWindowProc call the timer callback.
                                         */
                                        break;
-                               case WM_BLND_3DX:
+                               case WM_BLND_NDOF_AXIS:
                                        {
                                                GHOST_TEventNDOFData ndofdata;
                                                system->m_ndofManager->GHOST_NDOFGetDatas(ndofdata);
@@ -854,6 +854,17 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                                                window, ndofdata));
                                        }
                                        break;
+                               case WM_BLND_NDOF_BTN:
+                                       {
+                                               GHOST_TEventNDOFData ndofdata;
+                                               system->m_ndofManager->GHOST_NDOFGetDatas(ndofdata);
+                                               system->m_eventManager->
+                                                       pushEvent(new GHOST_EventNDOF(
+                                                               system->getMilliSeconds(), 
+                                                               GHOST_kEventNDOFButton, 
+                                                               window, ndofdata));
+                                       }
+                                       break;
                        }
                }
                else {