Sunshine
latest
Self-hosted game stream host for Moonlight.
nvprefs_common.h
Go to the documentation of this file.
1
5
#pragma once
6
7
// platform includes
8
// disable clang-format header reordering
9
// clang-format off
10
#include <windows.h>
11
#include <aclapi.h>
12
// clang-format on
13
14
// local includes
15
#include "
src/utility.h
"
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
22
explicit
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
operator()(
void
*p) {
30
LocalFree(p);
31
}
32
};
33
34
template
<
typename
T>
35
using
safe_hlocal
=
util::uniq_ptr<std::remove_pointer_t<T>
,
safe_hlocal_deleter
>;
36
37
using
safe_sid
=
util::safe_ptr_v2<void, PVOID, FreeSid>
;
38
39
void
info_message(
const
std::wstring &message);
40
41
void
info_message(
const
std::string &message);
42
43
void
error_message(
const
std::wstring &message);
44
45
void
error_message(
const
std::string &message);
46
47
struct
nvprefs_options
{
48
bool
opengl_vulkan_on_dxgi =
true
;
49
bool
sunshine_high_power_mode =
true
;
50
};
51
52
nvprefs_options
get_nvprefs_options();
53
54
}
// namespace nvprefs
util::uniq_ptr
Definition
utility.h:530
nvprefs::nvprefs_options
Definition
nvprefs_common.h:47
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