Properly disable NDOF code when WITH_INPUT_NDOF is not define.
This commit is contained in:
parent
c1cf646bb7
commit
69b4962fc0
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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_
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user