InputSdl.h 698 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <anki/input/KeyCode.h>
  7. #include <SDL_keycode.h>
  8. #include <unordered_map>
  9. namespace anki
  10. {
  11. /// SDL input implementation
  12. class InputImpl
  13. {
  14. public:
  15. std::unordered_map<SDL_Keycode,
  16. KeyCode,
  17. std::hash<SDL_Keycode>,
  18. std::equal_to<SDL_Keycode>,
  19. HeapAllocator<std::pair<const SDL_Keycode, KeyCode>>>
  20. m_sdlToAnki;
  21. InputImpl(HeapAllocator<std::pair<const SDL_Keycode, KeyCode>>& alloc)
  22. : m_sdlToAnki(
  23. 10, std::hash<SDL_Keycode>(), std::equal_to<SDL_Keycode>(), alloc)
  24. {
  25. }
  26. };
  27. } // end namespace anki