sdl.h 918 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2018 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include <vector>
  7. #include "core/frontend/input.h"
  8. #include "input_common/main.h"
  9. union SDL_Event;
  10. namespace Common {
  11. class ParamPackage;
  12. } // namespace Common
  13. namespace InputCommon::Polling {
  14. class DevicePoller;
  15. enum class DeviceType;
  16. } // namespace InputCommon::Polling
  17. namespace InputCommon::SDL {
  18. class State {
  19. public:
  20. using Pollers = std::vector<std::unique_ptr<Polling::DevicePoller>>;
  21. /// Unregisters SDL device factories and shut them down.
  22. virtual ~State() = default;
  23. virtual Pollers GetPollers(Polling::DeviceType type) = 0;
  24. };
  25. class NullState : public State {
  26. public:
  27. Pollers GetPollers(Polling::DeviceType type) override {
  28. return {};
  29. }
  30. };
  31. std::unique_ptr<State> Init();
  32. } // namespace InputCommon::SDL