diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-08-02 14:20:47 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-08-02 14:20:47 +0400 |
commit | 69b4962fc06726aa3ea31b70554fa2cb1f04d2aa (patch) | |
tree | d678f06dd2eb4dc09d85c2f9e974456ff411c218 /intern/ghost | |
parent | c1cf646bb7deed6e318701597f605e12851cc534 (diff) |
Properly disable NDOF code when WITH_INPUT_NDOF is not define.
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_System.cpp | 4 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_System.h | 6 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 2 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 8 |
4 files changed, 19 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp index f601031f2b6..64c2c218a07 100644 --- a/intern/ghost/intern/GHOST_System.cpp +++ b/intern/ghost/intern/GHOST_System.cpp @@ -202,10 +202,12 @@ bool GHOST_System::dispatchEvents() { bool handled = false; +#ifdef WITH_INPUT_NDOF // NDOF Motion event is sent only once per dispatch, so do it now: if (m_ndofManager) { handled |= m_ndofManager->sendMotionEvent(); } +#endif if (m_eventManager) { handled |= m_eventManager->dispatchEvents(); @@ -319,10 +321,12 @@ GHOST_TSuccess GHOST_System::exit() delete m_eventManager; m_eventManager = 0; } +#ifdef WITH_INPUT_NDOF if (m_ndofManager) { delete m_ndofManager; m_ndofManager = 0; } +#endif return GHOST_kSuccess; } diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h index 9fb36292c2b..c1e70916be6 100644 --- a/intern/ghost/intern/GHOST_System.h +++ b/intern/ghost/intern/GHOST_System.h @@ -249,11 +249,13 @@ public: */ virtual inline GHOST_WindowManager* getWindowManager() const; +#ifdef WITH_INPUT_NDOF /** * Returns a pointer to our n-degree of freedeom manager. * @return A pointer to our n-degree of freedeom manager. */ virtual inline GHOST_NDOFManager* getNDOFManager() const; +#endif /** * Returns the state of all modifier keys. @@ -318,8 +320,10 @@ protected: /** The event manager. */ GHOST_EventManager* m_eventManager; +#ifdef WITH_INPUT_NDOF /** The N-degree of freedom device manager */ GHOST_NDOFManager* m_ndofManager; +#endif /** Prints all the events. */ #ifdef GHOST_DEBUG @@ -345,10 +349,12 @@ inline GHOST_WindowManager* GHOST_System::getWindowManager() const return m_windowManager; } +#ifdef WITH_INPUT_NDOF inline GHOST_NDOFManager* GHOST_System::getNDOFManager() const { return m_ndofManager; } +#endif #endif // _GHOST_SYSTEM_H_ diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 8f2df4c396d..17f0f2d6ecd 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -597,7 +597,9 @@ GHOST_TSuccess GHOST_SystemCocoa::init() GHOST_TSuccess success = GHOST_System::init(); if (success) { +#ifdef WITH_INPUT_NDOF m_ndofManager = new GHOST_NDOFManagerCocoa(*this); +#endif //ProcessSerialNumber psn; diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 1b43fa92bb2..4af5643eb75 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -161,7 +161,9 @@ GHOST_SystemWin32::GHOST_SystemWin32() // Require COM for GHOST_DropTargetWin32 created in GHOST_WindowWin32. OleInitialize(0); +#ifdef WITH_INPUT_NDOF m_ndofManager = new GHOST_NDOFManagerWin32(*this); +#endif } GHOST_SystemWin32::~GHOST_SystemWin32() @@ -757,6 +759,7 @@ void GHOST_SystemWin32::processMinMaxInfo(MINMAXINFO * minmax) minmax->ptMinTrackSize.y=240; } +#ifdef WITH_INPUT_NDOF bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw) { bool eventSent = false; @@ -773,7 +776,7 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw) if (info.dwType == RIM_TYPEHID) m_ndofManager->setDevice(info.hid.dwVendorId, info.hid.dwProductId); else - puts("<!> not a HID device... mouse/kb perhaps?"); + puts("<!> not a HID device... mouse/kb perhaps?"); firstEvent = false; } @@ -846,6 +849,7 @@ bool GHOST_SystemWin32::processNDOF(RAWINPUT const& raw) } return eventSent; } +#endif // WITH_INPUT_NDOF LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -892,8 +896,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, } break; case RIM_TYPEHID: +#ifdef WITH_INPUT_NDOF if (system->processNDOF(raw)) eventHandled = true; +#endif break; } break; |