CmOISPlugin.cpp 733 B

1234567891011121314151617181920212223
  1. #include "CmOISPrerequisites.h"
  2. #include "CmInputHandlerOIS.h"
  3. #include "CmApplication.h"
  4. #include "CmInput.h"
  5. namespace CamelotEngine
  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. InputHandlerPtr inputHandler = InputHandlerPtr(CM_NEW(InputHandlerOIS, GenAlloc) InputHandlerOIS(windowId), &MemAllocDeleter<InputHandlerOIS, GenAlloc>::deleter);
  17. gInput().registerInputHandler(inputHandler);
  18. }
  19. }