summaryrefslogtreecommitdiffstats
path: root/src/libs/dxvk-native-1.9.2a/include/native/wsi/native_sdl2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dxvk-native-1.9.2a/include/native/wsi/native_sdl2.h')
-rw-r--r--src/libs/dxvk-native-1.9.2a/include/native/wsi/native_sdl2.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/libs/dxvk-native-1.9.2a/include/native/wsi/native_sdl2.h b/src/libs/dxvk-native-1.9.2a/include/native/wsi/native_sdl2.h
new file mode 100644
index 00000000..9281c403
--- /dev/null
+++ b/src/libs/dxvk-native-1.9.2a/include/native/wsi/native_sdl2.h
@@ -0,0 +1,26 @@
+#include <cstdint>
+#include <windows.h>
+
+#include <SDL2/SDL.h>
+
+namespace dxvk::wsi {
+
+ inline SDL_Window* fromHwnd(HWND hWindow) {
+ return reinterpret_cast<SDL_Window*>(hWindow);
+ }
+
+ inline HWND toHwnd(SDL_Window* pWindow) {
+ return reinterpret_cast<HWND>(pWindow);
+ }
+
+ // Offset so null HMONITORs go to -1
+ inline int32_t fromHmonitor(HMONITOR hMonitor) {
+ return static_cast<int32_t>(reinterpret_cast<intptr_t>(hMonitor)) - 1;
+ }
+
+ // Offset so -1 display id goes to 0 == NULL
+ inline HMONITOR toHmonitor(int32_t displayId) {
+ return reinterpret_cast<HMONITOR>(static_cast<intptr_t>(displayId + 1));
+ }
+
+} \ No newline at end of file