FreeLookConfig.h 795 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2020 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. // IMPORTANT: UI etc should modify the value returned by FreeLook::GetConfig().
  4. // Free Look code should read from the value returned by FreeLook::GetActiveConfig().
  5. // The reason for this is to get rid of race conditions etc when the
  6. // configuration changes in the middle of a frame.
  7. #pragma once
  8. namespace FreeLook
  9. {
  10. enum class ControlType : int
  11. {
  12. SixAxis,
  13. FPS,
  14. Orbital
  15. };
  16. struct CameraConfig
  17. {
  18. ControlType control_type;
  19. };
  20. // NEVER inherit from this class.
  21. struct Config final
  22. {
  23. Config();
  24. void Refresh();
  25. CameraConfig camera_config;
  26. bool enabled;
  27. };
  28. Config& GetConfig();
  29. const Config& GetActiveConfig();
  30. // Called every frame.
  31. void UpdateActiveConfig();
  32. } // namespace FreeLook