Sunshine v2025.118.151840
Self-hosted game stream host for Moonlight.
input.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <functional>
8
9#include "platform/common.h"
10#include "thread_safe.h"
11
12namespace input {
13 struct input_t;
14
15 void
16 print(void *input);
17 void
18 reset(std::shared_ptr<input_t> &input);
19 void
20 passthrough(std::shared_ptr<input_t> &input, std::vector<std::uint8_t> &&input_data);
21
22 [[nodiscard]] std::unique_ptr<platf::deinit_t>
23 init();
24
25 bool
26 probe_gamepads();
27
28 std::shared_ptr<input_t>
29 alloc(safe::mail_t mail);
30
32 int env_width, env_height;
33
34 // Offset x and y coordinates of the client
35 float client_offsetX, client_offsetY;
36
37 float scalar_inv;
38
39 explicit
40 operator bool() const {
41 return width != 0 && height != 0 && env_width != 0 && env_height != 0;
42 }
43 };
44
52 std::pair<float, float>
53 scale_client_contact_area(const std::pair<float, float> &val, uint16_t rotation, const std::pair<float, float> &scalar);
54} // namespace input
Declarations for common platform specific utilities.
std::unique_ptr< platf::deinit_t > init(const std::filesystem::path &persistence_filepath, const config::video_t &video_config)
Initialize the implementation and perform the initial state recovery (if needed).
Definition display_device.cpp:721
std::pair< float, float > scale_client_contact_area(const std::pair< float, float > &val, uint16_t rotation, const std::pair< float, float > &scalar)
Scale the ellipse axes according to the provided size.
Definition input.cpp:520
Handles process-wide communication.
Definition globals.h:33
Definition input.h:31
Definition common.h:246
Declarations for thread-safe data structures.