1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-04 16:24:29 +01:00
dxvk/include/native/wsi/native_sdl3.h
Ethan Lee 469025d234 native: Add SDL3 WSI
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2024-10-27 12:58:22 +01:00

26 lines
596 B
C++

#include <windows.h>
#include <SDL3/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 SDL_DisplayID fromHmonitor(HMONITOR hMonitor) {
return SDL_DisplayID(reinterpret_cast<uintptr_t>(hMonitor));
}
// Offset so -1 display id goes to 0 == NULL
inline HMONITOR toHmonitor(SDL_DisplayID display) {
return reinterpret_cast<HMONITOR>(uintptr_t(display));
}
}