diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-13 12:09:31 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-13 12:09:31 +0200 |
commit | 9eba54d16f19fc976b64a678c151a6f03883658c (patch) | |
tree | 5ca62f4d832c0fc5807d664cc723d50afb210037 /src | |
parent | 7a433a12f0e4989f2f473a40fbac550d5daae6dc (diff) |
Windows: Cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/win32.c | 22 | ||||
-rw-r--r-- | src/win32.h | 5 |
2 files changed, 12 insertions, 15 deletions
diff --git a/src/win32.c b/src/win32.c index 504cfe90..8f7bdc02 100644 --- a/src/win32.c +++ b/src/win32.c | |||
@@ -28,6 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
28 | #define WIN32_LEAN_AND_MEAN | 28 | #define WIN32_LEAN_AND_MEAN |
29 | #include <Windows.h> | 29 | #include <Windows.h> |
30 | #include <windowsx.h> | 30 | #include <windowsx.h> |
31 | #include <dwmapi.h> | ||
31 | #include <d2d1.h> | 32 | #include <d2d1.h> |
32 | 33 | ||
33 | void setDPIAware_Win32(void) { | 34 | void setDPIAware_Win32(void) { |
@@ -63,18 +64,6 @@ void useExecutableIconResource_SDLWindow(SDL_Window *win) { | |||
63 | } | 64 | } |
64 | } | 65 | } |
65 | 66 | ||
66 | #if 0 | ||
67 | void setup_SDLWindow(SDL_Window *win) { | ||
68 | SDL_SysWMinfo wmInfo; | ||
69 | SDL_VERSION(&wmInfo.version); | ||
70 | if (SDL_GetWindowWMInfo(win, &wmInfo)) { | ||
71 | HWND hwnd = wmInfo.info.win.window; | ||
72 | // printf("configuring window\n"); | ||
73 | // SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) | WS_SYSMENU); | ||
74 | } | ||
75 | } | ||
76 | #endif | ||
77 | |||
78 | #if defined (LAGRANGE_CUSTOM_FRAME) | 67 | #if defined (LAGRANGE_CUSTOM_FRAME) |
79 | iInt2 cursor_Win32(void) { | 68 | iInt2 cursor_Win32(void) { |
80 | POINT p; | 69 | POINT p; |
@@ -85,12 +74,17 @@ iInt2 cursor_Win32(void) { | |||
85 | void processNativeEvent_Win32(const struct SDL_SysWMmsg *msg, iWindow *window) { | 74 | void processNativeEvent_Win32(const struct SDL_SysWMmsg *msg, iWindow *window) { |
86 | static int winDown_[2] = { 0, 0 }; | 75 | static int winDown_[2] = { 0, 0 }; |
87 | HWND hwnd = msg->msg.win.hwnd; | 76 | HWND hwnd = msg->msg.win.hwnd; |
88 | printf("[syswm] %x\n", msg->msg.win.msg); fflush(stdout); | 77 | //printf("[syswm] %x\n", msg->msg.win.msg); fflush(stdout); |
89 | const WPARAM wp = msg->msg.win.wParam; | 78 | const WPARAM wp = msg->msg.win.wParam; |
90 | switch (msg->msg.win.msg) { | 79 | switch (msg->msg.win.msg) { |
80 | case WM_ACTIVATE: { | ||
81 | //LONG style = GetWindowLong(hwnd, GWL_STYLE); | ||
82 | //SetWindowLog(hwnd, GWL_STYLE, style); | ||
83 | break; | ||
84 | } | ||
91 | case WM_KEYDOWN: { | 85 | case WM_KEYDOWN: { |
92 | if (wp == VK_LWIN) { | 86 | if (wp == VK_LWIN) { |
93 | printf("lwin down\n"); fflush(stdout); | 87 | //printf("lwin down\n"); fflush(stdout); |
94 | winDown_[0] = iTrue; | 88 | winDown_[0] = iTrue; |
95 | } | 89 | } |
96 | else if (wp == VK_RWIN) { | 90 | else if (wp == VK_RWIN) { |
diff --git a/src/win32.h b/src/win32.h index 4b8f00da..27aa0539 100644 --- a/src/win32.h +++ b/src/win32.h | |||
@@ -31,6 +31,9 @@ iDeclareType(Window) | |||
31 | void setDPIAware_Win32(void); | 31 | void setDPIAware_Win32(void); |
32 | float desktopDPI_Win32(void); | 32 | float desktopDPI_Win32(void); |
33 | void useExecutableIconResource_SDLWindow(SDL_Window *win); | 33 | void useExecutableIconResource_SDLWindow(SDL_Window *win); |
34 | void processNativeEvent_Win32(const struct SDL_SysWMmsg *msg, iWindow *window); | ||
35 | 34 | ||
35 | #if defined (LAGRANGE_CUSTOM_FRAME) | ||
36 | iInt2 cursor_Win32(void); | 36 | iInt2 cursor_Win32(void); |
37 | void processNativeEvent_Win32(const struct SDL_SysWMmsg *msg, iWindow *window); | ||
38 | void setup_SDLWindow(SDL_Window *); | ||
39 | #endif | ||