Sunshine latest
Self-hosted game stream host for Moonlight.
input.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <functional>
9
10// local includes
11#include "platform/common.h"
12#include "thread_safe.h"
13
14namespace input {
15 struct input_t;
16
17 void print(void *input);
18 void reset(std::shared_ptr<input_t> &input);
19 void passthrough(std::shared_ptr<input_t> &input, std::vector<std::uint8_t> &&input_data);
20
21 [[nodiscard]] std::unique_ptr<platf::deinit_t> init();
22
23 bool probe_gamepads();
24
25 std::shared_ptr<input_t> alloc(safe::mail_t mail);
26
28 int env_width, env_height;
29
30 // Offset x and y coordinates of the client
31 float client_offsetX, client_offsetY;
32
33 float scalar_inv;
34
35 explicit operator bool() const {
36 return width != 0 && height != 0 && env_width != 0 && env_height != 0;
37 }
38 };
39
47 std::pair<float, float> scale_client_contact_area(const std::pair<float, float> &val, uint16_t rotation, const std::pair<float, float> &scalar);
48} // 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:704
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:506
Handles process-wide communication.
Definition globals.h:34
Definition input.h:27
Definition common.h:252
Declarations for thread-safe data structures.