Sunshine master
Self-hosted game stream host for Moonlight.
undo_data.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <cstdint>
9#include <optional>
10#include <string>
11#include <vector>
12
13namespace nvprefs {
14
19 public:
23 struct data_t {
28 uint32_t our_value;
29 std::optional<uint32_t> undo_value;
30 };
31
32 std::optional<opengl_swapchain_t> opengl_swapchain;
33 };
34
41 void set_opengl_swapchain(uint32_t our_value, std::optional<uint32_t> undo_value);
42
48 std::optional<data_t::opengl_swapchain_t> get_opengl_swapchain() const;
49
55 std::string write() const;
56
62 void read(const std::vector<char> &buffer);
63
69 void merge(const undo_data_t &newer_data);
70
71 private:
72 data_t data;
73 };
74
75} // namespace nvprefs
Serializable NVIDIA profile state saved before preference changes.
Definition undo_data.h:18
void set_opengl_swapchain(uint32_t our_value, std::optional< uint32_t > undo_value)
Set opengl swapchain.
Definition undo_data.cpp:122
std::optional< data_t::opengl_swapchain_t > get_opengl_swapchain() const
Get opengl swapchain.
Definition undo_data.cpp:129
void read(const std::vector< char > &buffer)
Read persisted data into the current object.
Definition undo_data.cpp:145
void merge(const undo_data_t &newer_data)
Merge newer undo data with the current data set.
Definition undo_data.cpp:154
std::string write() const
Serialize undo data to its JSON representation.
Definition undo_data.cpp:133
OpenGL swapchain setting values captured from the driver.
Definition undo_data.h:27
uint32_t our_value
NVIDIA setting value applied by Sunshine.
Definition undo_data.h:28
std::optional< uint32_t > undo_value
Previous NVIDIA setting value to restore, if present.
Definition undo_data.h:29
NVIDIA profile settings captured for undo.
Definition undo_data.h:23
std::optional< opengl_swapchain_t > opengl_swapchain
Opengl swapchain.
Definition undo_data.h:32