2022-08-21 01:11:36 +02:00
|
|
|
#include <windows.h>
|
|
|
|
|
2024-02-10 19:06:33 +01:00
|
|
|
#include <SDL.h>
|
2022-08-21 01:11:36 +02:00
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2024-02-10 19:06:33 +01:00
|
|
|
}
|