1 | #include <windows.h>
|
---|
2 |
|
---|
3 | namespace dxvk::wsi {
|
---|
4 |
|
---|
5 | inline void* fromHwnd(HWND hWindow) {
|
---|
6 | return reinterpret_cast<void*>(hWindow);
|
---|
7 | }
|
---|
8 |
|
---|
9 | inline HWND toHwnd(void* pWindow) {
|
---|
10 | return reinterpret_cast<HWND>(pWindow);
|
---|
11 | }
|
---|
12 |
|
---|
13 | // Offset so null HMONITORs go to -1
|
---|
14 | inline int32_t fromHmonitor(HMONITOR hMonitor) {
|
---|
15 | return static_cast<int32_t>(reinterpret_cast<intptr_t>(hMonitor)) - 1;
|
---|
16 | }
|
---|
17 |
|
---|
18 | // Offset so -1 display id goes to 0 == NULL
|
---|
19 | inline HMONITOR toHmonitor(int32_t displayId) {
|
---|
20 | return reinterpret_cast<HMONITOR>(static_cast<intptr_t>(displayId + 1));
|
---|
21 | }
|
---|
22 |
|
---|
23 | }
|
---|