diff options
| author | 2022-06-18 23:32:07 -0500 | |
|---|---|---|
| committer | 2022-07-23 19:38:42 -0500 | |
| commit | f19e7be6e84357234c9fdae3395f988a9bb1ac5b (patch) | |
| tree | cc93872ac739fd7b967f8f62ea6abf2c8639221d /src/input_common/main.cpp | |
| parent | Merge pull request #8545 from Kelebek1/Audio (diff) | |
| download | yuzu-f19e7be6e84357234c9fdae3395f988a9bb1ac5b.tar.gz yuzu-f19e7be6e84357234c9fdae3395f988a9bb1ac5b.tar.xz yuzu-f19e7be6e84357234c9fdae3395f988a9bb1ac5b.zip | |
input_common: Add camera driver
Diffstat (limited to 'src/input_common/main.cpp')
| -rw-r--r-- | src/input_common/main.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index 21834fb6b..ca1cb9542 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <memory> | 5 | #include <memory> |
| 6 | #include "common/input.h" | 6 | #include "common/input.h" |
| 7 | #include "common/param_package.h" | 7 | #include "common/param_package.h" |
| 8 | #include "input_common/drivers/camera.h" | ||
| 8 | #include "input_common/drivers/gc_adapter.h" | 9 | #include "input_common/drivers/gc_adapter.h" |
| 9 | #include "input_common/drivers/keyboard.h" | 10 | #include "input_common/drivers/keyboard.h" |
| 10 | #include "input_common/drivers/mouse.h" | 11 | #include "input_common/drivers/mouse.h" |
| @@ -78,6 +79,15 @@ struct InputSubsystem::Impl { | |||
| 78 | Common::Input::RegisterFactory<Common::Input::OutputDevice>(tas_input->GetEngineName(), | 79 | Common::Input::RegisterFactory<Common::Input::OutputDevice>(tas_input->GetEngineName(), |
| 79 | tas_output_factory); | 80 | tas_output_factory); |
| 80 | 81 | ||
| 82 | camera = std::make_shared<Camera>("camera"); | ||
| 83 | camera->SetMappingCallback(mapping_callback); | ||
| 84 | camera_input_factory = std::make_shared<InputFactory>(camera); | ||
| 85 | camera_output_factory = std::make_shared<OutputFactory>(camera); | ||
| 86 | Common::Input::RegisterFactory<Common::Input::InputDevice>(camera->GetEngineName(), | ||
| 87 | camera_input_factory); | ||
| 88 | Common::Input::RegisterFactory<Common::Input::OutputDevice>(camera->GetEngineName(), | ||
| 89 | camera_output_factory); | ||
| 90 | |||
| 81 | #ifdef HAVE_SDL2 | 91 | #ifdef HAVE_SDL2 |
| 82 | sdl = std::make_shared<SDLDriver>("sdl"); | 92 | sdl = std::make_shared<SDLDriver>("sdl"); |
| 83 | sdl->SetMappingCallback(mapping_callback); | 93 | sdl->SetMappingCallback(mapping_callback); |
| @@ -317,6 +327,7 @@ struct InputSubsystem::Impl { | |||
| 317 | std::shared_ptr<TouchScreen> touch_screen; | 327 | std::shared_ptr<TouchScreen> touch_screen; |
| 318 | std::shared_ptr<TasInput::Tas> tas_input; | 328 | std::shared_ptr<TasInput::Tas> tas_input; |
| 319 | std::shared_ptr<CemuhookUDP::UDPClient> udp_client; | 329 | std::shared_ptr<CemuhookUDP::UDPClient> udp_client; |
| 330 | std::shared_ptr<Camera> camera; | ||
| 320 | 331 | ||
| 321 | std::shared_ptr<InputFactory> keyboard_factory; | 332 | std::shared_ptr<InputFactory> keyboard_factory; |
| 322 | std::shared_ptr<InputFactory> mouse_factory; | 333 | std::shared_ptr<InputFactory> mouse_factory; |
| @@ -324,12 +335,14 @@ struct InputSubsystem::Impl { | |||
| 324 | std::shared_ptr<InputFactory> touch_screen_factory; | 335 | std::shared_ptr<InputFactory> touch_screen_factory; |
| 325 | std::shared_ptr<InputFactory> udp_client_input_factory; | 336 | std::shared_ptr<InputFactory> udp_client_input_factory; |
| 326 | std::shared_ptr<InputFactory> tas_input_factory; | 337 | std::shared_ptr<InputFactory> tas_input_factory; |
| 338 | std::shared_ptr<InputFactory> camera_input_factory; | ||
| 327 | 339 | ||
| 328 | std::shared_ptr<OutputFactory> keyboard_output_factory; | 340 | std::shared_ptr<OutputFactory> keyboard_output_factory; |
| 329 | std::shared_ptr<OutputFactory> mouse_output_factory; | 341 | std::shared_ptr<OutputFactory> mouse_output_factory; |
| 330 | std::shared_ptr<OutputFactory> gcadapter_output_factory; | 342 | std::shared_ptr<OutputFactory> gcadapter_output_factory; |
| 331 | std::shared_ptr<OutputFactory> udp_client_output_factory; | 343 | std::shared_ptr<OutputFactory> udp_client_output_factory; |
| 332 | std::shared_ptr<OutputFactory> tas_output_factory; | 344 | std::shared_ptr<OutputFactory> tas_output_factory; |
| 345 | std::shared_ptr<OutputFactory> camera_output_factory; | ||
| 333 | 346 | ||
| 334 | #ifdef HAVE_SDL2 | 347 | #ifdef HAVE_SDL2 |
| 335 | std::shared_ptr<SDLDriver> sdl; | 348 | std::shared_ptr<SDLDriver> sdl; |
| @@ -382,6 +395,14 @@ const TasInput::Tas* InputSubsystem::GetTas() const { | |||
| 382 | return impl->tas_input.get(); | 395 | return impl->tas_input.get(); |
| 383 | } | 396 | } |
| 384 | 397 | ||
| 398 | Camera* InputSubsystem::GetCamera() { | ||
| 399 | return impl->camera.get(); | ||
| 400 | } | ||
| 401 | |||
| 402 | const Camera* InputSubsystem::GetCamera() const { | ||
| 403 | return impl->camera.get(); | ||
| 404 | } | ||
| 405 | |||
| 385 | std::vector<Common::ParamPackage> InputSubsystem::GetInputDevices() const { | 406 | std::vector<Common::ParamPackage> InputSubsystem::GetInputDevices() const { |
| 386 | return impl->GetInputDevices(); | 407 | return impl->GetInputDevices(); |
| 387 | } | 408 | } |