Sunshine v2025.118.151840
Self-hosted game stream host for Moonlight.
misc.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <chrono>
8#include <string_view>
9#include <windows.h>
10#include <winnt.h>
11
12namespace platf {
13 void
14 print_status(const std::string_view &prefix, HRESULT status);
15 HDESK
16 syncThreadDesktop();
17
18 int64_t
19 qpc_counter();
20
21 std::chrono::nanoseconds
22 qpc_time_difference(int64_t performance_counter1, int64_t performance_counter2);
23
29 std::wstring
30 from_utf8(const std::string &string);
31
37 std::string
38 to_utf8(const std::wstring &string);
39} // namespace platf
std::wstring from_utf8(const std::string &string)
Convert a UTF-8 string into a UTF-16 wide string.
Definition misc.cpp:1794
std::string to_utf8(const std::wstring &string)
Convert a UTF-16 wide string into a UTF-8 string.
Definition misc.cpp:1821