Add API for saving driver prefs. Save fullscreen state in D3D11 driver.

This commit is contained in:
elasota
2020-07-03 02:46:43 -04:00
parent ed9e0fec97
commit 05604e5604
23 changed files with 542 additions and 51 deletions

View File

@@ -3,6 +3,7 @@
#include <stdint.h>
struct IGpAudioChannel;
struct IGpPrefsHandler;
struct IGpAudioDriver
{
@@ -12,4 +13,6 @@ public:
virtual void SetMasterVolume(uint32_t vol, uint32_t maxVolume) = 0;
virtual void Shutdown() = 0;
virtual IGpPrefsHandler *GetPrefsHandler() const = 0;
};

View File

@@ -5,6 +5,7 @@
struct IGpDisplayDriverSurface;
struct IGpCursor;
struct IGpPrefsHandler;
struct GpDisplayDriverProperties;
struct GpDisplayDriverSurfaceEffects
@@ -45,6 +46,7 @@ public:
virtual void RequestResetVirtualResolution() = 0;
virtual const GpDisplayDriverProperties &GetProperties() const = 0;
virtual IGpPrefsHandler *GetPrefsHandler() const = 0;
};
inline GpDisplayDriverSurfaceEffects::GpDisplayDriverSurfaceEffects()

View File

@@ -1,7 +1,11 @@
#pragma once
struct IGpPrefsHandler;
struct IGpInputDriver
{
virtual void ProcessInput() = 0;
virtual void Shutdown() = 0;
virtual IGpPrefsHandler *GetPrefsHandler() const = 0;
};

View File

@@ -0,0 +1,11 @@
#pragma once
#include <stdint.h>
struct IGpPrefsHandler
{
typedef bool (*WritePrefsFunc_t) (void *context, const void *identifier, size_t identifierSize, const void *contents, size_t contentsSize, uint32_t version);
virtual void ApplyPrefs(const void *identifier, size_t identifierSize, const void *contents, size_t contentsSize, uint32_t version) = 0;
virtual bool SavePrefs(void *context, WritePrefsFunc_t writeFunc) = 0;
};