Ticket #31974: patch-src_OISInputManager.cpp.diff

File patch-src_OISInputManager.cpp.diff, 944 bytes (added by marin.saric@…, 13 years ago)
  • src/OISInputManager.cpp

     
    3535#elif defined OIS_LINUX_PLATFORM
    3636#  include "linux/LinuxInputManager.h"
    3737#elif defined OIS_APPLE_PLATFORM
     38#  include "mac/CocoaInputManager.h"
    3839#  include "mac/MacInputManager.h"
    3940#elif defined OIS_IPHONE_PLATFORM
    4041#  include "iphone/iPhoneInputManager.h"
     
    113114#elif defined OIS_LINUX_PLATFORM
    114115        im = new LinuxInputManager();
    115116#elif defined OIS_APPLE_PLATFORM
    116         im = new MacInputManager();
     117        ParamList::iterator i = paramList.find("WINDOW");
     118        if(i != paramList.end())
     119    {
     120        id obj = (id)strtoul(i->second.c_str(), 0, 10);
     121        if(obj && [obj isKindOfClass:[NSWindow class]])
     122            im = new CocoaInputManager();
     123#ifndef __LP64__
     124        else
     125            im = new MacInputManager();
     126#endif
     127    }
    117128#elif defined OIS_IPHONE_PLATFORM
    118129        im = new iPhoneInputManager();
    119130#else