InputSdl.h 695 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (C) 2009-2015, 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. /// SDL input implementation
  11. class InputImpl
  12. {
  13. public:
  14. std::unordered_map<
  15. SDL_Keycode,
  16. KeyCode,
  17. std::hash<SDL_Keycode>,
  18. std::equal_to<SDL_Keycode>,
  19. HeapAllocator<std::pair<const SDL_Keycode, KeyCode>>> m_sdlToAnki;
  20. InputImpl(HeapAllocator<std::pair<const SDL_Keycode, KeyCode>>& alloc)
  21. : m_sdlToAnki(10, std::hash<SDL_Keycode>(),
  22. std::equal_to<SDL_Keycode>(), alloc)
  23. {}
  24. };
  25. } // end namespace anki