我有这个错误,我无法弄清楚问题是什么。错误是:kCGWindowBound <---称为对象类型'CFStringRef'(又名'const_CFString *')不是OSX 10.7.4上的函数或函数指针Xcode 4.3.3
void MacMouse::_initialize(){
mState.clear();
mTempState.clear();
mMouseWarped = false;
// Hide OS Mouse
CGDisplayHideCursor(kCGDirectMainDisplay);
MacInputManager* im = static_cast<MacInputManager*>(mCreator);
WindowRef win = im->_getWindow();
if(win)
{
Rect clipRect = {0.0f, 0.0f, 0.0f, 0.0f};
kCGWindowBounds(win, kWindowContentRgn, &clipRect);
CGPoint warpPoint;
warpPoint.x = ((clipRect.right - clipRect.left) / 2) + clipRect.left;
warpPoint.y = ((clipRect.bottom - clipRect.top) / 2) + clipRect.top;
CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, warpPoint); //Place at display origin
mMouseWarped = true;
}
//Now that mouse is warped, start listening for events
EventTargetRef event = ((MacInputManager*)mCreator)->_getEventTarget();
if(mouseEventRef != NULL)
RemoveEventHandler(mouseEventRef);
if(mWindowFocusHandler != NULL)
RemoveEventHandler(mWindowFocusHandler);
mouseEventRef = mWindowFocusHandler = NULL;
if(InstallEventHandler(event, mouseUPP, GetEventTypeCount(mouseEvents), mouseEvents, this, &mouseEventRef) != noErr)
OIS_EXCEPT( E_General, "MacMouse::_initialize >> Error loading Mouse event handler" );
if(InstallEventHandler(event, mWindowFocusListener, GetEventTypeCount(WinFocusAcquired), WinFocusAcquired, this, &mWindowFocusHandler) != noErr)
OIS_EXCEPT( E_General, "MacMouse::_initialize >> Error loading Mouse event handler" );
//Lock OS Mouse movement
mNeedsToRegainFocus = false;
CGAssociateMouseAndMouseCursorPosition(FALSE);
}