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