diff options
Diffstat (limited to '')
-rw-r--r-- | src/libs/dxvk-native-1.9.2a/src/wsi/sdl2/wsi_monitor_sdl2.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/libs/dxvk-native-1.9.2a/src/wsi/sdl2/wsi_monitor_sdl2.cpp b/src/libs/dxvk-native-1.9.2a/src/wsi/sdl2/wsi_monitor_sdl2.cpp new file mode 100644 index 00000000..4125457b --- /dev/null +++ b/src/libs/dxvk-native-1.9.2a/src/wsi/sdl2/wsi_monitor_sdl2.cpp @@ -0,0 +1,63 @@ +#include "../wsi_monitor.h" + +#include "wsi_helpers_sdl2.h" + +#include <windows.h> +#include <wsi/native_wsi.h> + +#include <string> +#include <sstream> + +namespace dxvk::wsi { + + HMONITOR getDefaultMonitor() { + return enumMonitors(0); + } + + + HMONITOR enumMonitors(uint32_t index) { + return isDisplayValid(int32_t(index)) + ? toHmonitor(index) + : nullptr; + } + + bool getDisplayName( + HMONITOR hMonitor, + WCHAR (&Name)[32]) { + const int32_t displayId = fromHmonitor(hMonitor); + + if (!isDisplayValid(displayId)) + return false; + + std::wstringstream nameStream; + nameStream << LR"(\\.\DISPLAY)" << (displayId + 1); + + std::wstring name = nameStream.str(); + + std::memset(Name, 0, sizeof(Name)); + name.copy(Name, name.length(), 0); + + return true; + } + + + bool getDesktopCoordinates( + HMONITOR hMonitor, + RECT* pRect) { + const int32_t displayId = fromHmonitor(hMonitor); + + if (!isDisplayValid(displayId)) + return false; + + SDL_Rect rect = { }; + SDL_GetDisplayBounds(displayId, &rect); + + pRect->left = rect.x; + pRect->top = rect.y; + pRect->right = rect.x + rect.w; + pRect->bottom = rect.y + rect.h; + + return true; + } + +}
\ No newline at end of file |