BsWin32Input.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #define WIN32_LEAN_AND_MEAN
  6. #define DIRECTINPUT_VERSION 0x0800
  7. #include <windows.h>
  8. #include <dinput.h>
  9. #include <Xinput.h>
  10. #include <wbemidl.h>
  11. #include <oleauto.h>
  12. namespace bs
  13. {
  14. /** Information about a gamepad from DirectInput. */
  15. struct GamepadInfo
  16. {
  17. UINT32 id;
  18. GUID guidInstance;
  19. GUID guidProduct;
  20. String name;
  21. bool isXInput;
  22. int xInputDev;
  23. };
  24. /**
  25. * Data specific to Win32 implementation of the input system. Can be passed to platform specific implementations of
  26. * the individual device types.
  27. */
  28. struct InputPrivateData
  29. {
  30. IDirectInput8* directInput;
  31. Vector<GamepadInfo> gamepadInfos;
  32. DWORD kbSettings;
  33. DWORD mouseSettings;
  34. };
  35. // Max number of elements to collect from buffered DirectInput
  36. #define DI_BUFFER_SIZE_KEYBOARD 17
  37. #define DI_BUFFER_SIZE_MOUSE 128
  38. #define DI_BUFFER_SIZE_GAMEPAD 129
  39. }