From 1609fd61bcd4acd49d53a46a520baf28c51895c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Luc=20Peuri=C3=A8re?= Date: Thu, 2 Aug 2007 20:45:55 +0000 Subject: [PATCH] windows ndof support added by Ettore Pasquini --- intern/ghost/GHOST_Types.h | 3 ++- intern/ghost/intern/GHOST_SystemWin32.cpp | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index 379b3323f53..7b791c44fd8 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -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) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 89a96987113..5f4bfe9d668 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -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 {