CmOISPlugin.cpp 686 B

12345678910111213141516171819202122232425
  1. #include "CmOISPrerequisites.h"
  2. #include "CmInputHandlerOIS.h"
  3. #include "CmApplication.h"
  4. #include "CmInput.h"
  5. namespace BansheeEngine
  6. {
  7. extern "C" CM_OIS_EXPORT const String& getPluginName()
  8. {
  9. static String pluginName = "OISInput";
  10. return pluginName;
  11. }
  12. extern "C" CM_OIS_EXPORT void* loadPlugin()
  13. {
  14. // TODO - Window handles in Windows are 64 bits when compiled as x64, but OIS only accepts a 32bit value. Is this okay?
  15. UINT32 windowId = (UINT32)gApplication().getAppWindowId();
  16. std::shared_ptr<RawInputHandler> inputHandler = cm_shared_ptr<InputHandlerOIS>(windowId);
  17. gInput()._registerRawInputHandler(inputHandler);
  18. return nullptr;
  19. }
  20. }