Sunshine
v2025.118.151840
Self-hosted game stream host for Moonlight.
nvprefs_common.h
Go to the documentation of this file.
1
5
#pragma once
6
7
// sunshine utility header for generic smart pointers
8
#include "
src/utility.h
"
9
10
// winapi headers
11
// disable clang-format header reordering
12
// clang-format off
13
#include <windows.h>
14
#include <aclapi.h>
15
// clang-format on
16
17
namespace
nvprefs {
18
19
struct
safe_handle
:
public
util::safe_ptr_v2
<void, BOOL, CloseHandle> {
20
using
util::safe_ptr_v2
<void, BOOL, CloseHandle>::safe_ptr_v2;
21
explicit
22
operator
bool()
const
{
23
auto
handle = get();
24
return
handle != NULL && handle != INVALID_HANDLE_VALUE;
25
}
26
};
27
28
struct
safe_hlocal_deleter
{
29
void
30
operator()(
void
*p) {
31
LocalFree(p);
32
}
33
};
34
35
template
<
typename
T>
36
using
safe_hlocal
=
util::uniq_ptr<std::remove_pointer_t<T>
,
safe_hlocal_deleter
>;
37
38
using
safe_sid
=
util::safe_ptr_v2<void, PVOID, FreeSid>
;
39
40
void
41
info_message(
const
std::wstring &message);
42
43
void
44
info_message(
const
std::string &message);
45
46
void
47
error_message(
const
std::wstring &message);
48
49
void
50
error_message(
const
std::string &message);
51
52
struct
nvprefs_options
{
53
bool
opengl_vulkan_on_dxgi =
true
;
54
bool
sunshine_high_power_mode =
true
;
55
};
56
57
nvprefs_options
58
get_nvprefs_options();
59
60
}
// namespace nvprefs
util::uniq_ptr
Definition
utility.h:496
nvprefs::nvprefs_options
Definition
nvprefs_common.h:52
nvprefs::safe_handle
Definition
nvprefs_common.h:19
nvprefs::safe_hlocal_deleter
Definition
nvprefs_common.h:28
utility.h
Declarations for utility functions.
src
platform
windows
nvprefs
nvprefs_common.h
Generated by
1.10.0