Mercurial > sdl-ios-xcode
comparison src/video/windows/SDL_windowswindow.c @ 5088:c2539ff054c8
Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 24 Jan 2011 15:46:11 -0800 |
parents | e8916fe9cfc8 |
children | 455bc74f7034 |
comparison
equal
deleted
inserted
replaced
5087:e7680e2c9f3c | 5088:c2539ff054c8 |
---|---|
30 | 30 |
31 /* This is included after SDL_windowsvideo.h, which includes windows.h */ | 31 /* This is included after SDL_windowsvideo.h, which includes windows.h */ |
32 #include "SDL_syswm.h" | 32 #include "SDL_syswm.h" |
33 #include "SDL_gapirender.h" | 33 #include "SDL_gapirender.h" |
34 | 34 |
35 /* Windows CE compatibility */ | |
36 #ifndef SWP_NOCOPYBITS | |
37 #define SWP_NOCOPYBITS 0 | |
38 #endif | |
35 | 39 |
36 /* Fake window to help with DirectInput events. */ | 40 /* Fake window to help with DirectInput events. */ |
37 HWND SDL_HelperWindow = NULL; | 41 HWND SDL_HelperWindow = NULL; |
38 static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher"); | 42 static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher"); |
39 static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow"); | 43 static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow"); |
66 WIN_SetError("SetProp() failed"); | 70 WIN_SetError("SetProp() failed"); |
67 return -1; | 71 return -1; |
68 } | 72 } |
69 | 73 |
70 /* Set up the window proc function */ | 74 /* Set up the window proc function */ |
75 #ifdef GWLP_WNDPROC | |
71 data->wndproc = (WNDPROC) GetWindowLongPtr(hwnd, GWLP_WNDPROC); | 76 data->wndproc = (WNDPROC) GetWindowLongPtr(hwnd, GWLP_WNDPROC); |
72 if (data->wndproc == WIN_WindowProc) { | 77 if (data->wndproc == WIN_WindowProc) { |
73 data->wndproc = NULL; | 78 data->wndproc = NULL; |
74 } | 79 } else { |
75 else { | |
76 SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) WIN_WindowProc); | 80 SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) WIN_WindowProc); |
77 } | 81 } |
82 #else | |
83 data->wndproc = (WNDPROC) GetWindowLong(hwnd, GWL_WNDPROC); | |
84 if (data->wndproc == WIN_WindowProc) { | |
85 data->wndproc = NULL; | |
86 } else { | |
87 SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR) WIN_WindowProc); | |
88 } | |
89 #endif | |
78 | 90 |
79 /* Fill in the SDL window with the window data */ | 91 /* Fill in the SDL window with the window data */ |
80 { | 92 { |
81 POINT point; | 93 POINT point; |
82 point.x = 0; | 94 point.x = 0; |
110 if (style & WS_THICKFRAME) { | 122 if (style & WS_THICKFRAME) { |
111 window->flags |= SDL_WINDOW_RESIZABLE; | 123 window->flags |= SDL_WINDOW_RESIZABLE; |
112 } else { | 124 } else { |
113 window->flags &= ~SDL_WINDOW_RESIZABLE; | 125 window->flags &= ~SDL_WINDOW_RESIZABLE; |
114 } | 126 } |
127 #ifdef WS_MAXIMIZE | |
115 if (style & WS_MAXIMIZE) { | 128 if (style & WS_MAXIMIZE) { |
116 window->flags |= SDL_WINDOW_MAXIMIZED; | 129 window->flags |= SDL_WINDOW_MAXIMIZED; |
117 } else { | 130 } else |
131 #endif | |
132 { | |
118 window->flags &= ~SDL_WINDOW_MAXIMIZED; | 133 window->flags &= ~SDL_WINDOW_MAXIMIZED; |
119 } | 134 } |
135 #ifdef WS_MINIMIZE | |
120 if (style & WS_MINIMIZE) { | 136 if (style & WS_MINIMIZE) { |
121 window->flags |= SDL_WINDOW_MINIMIZED; | 137 window->flags |= SDL_WINDOW_MINIMIZED; |
122 } else { | 138 } else |
139 #endif | |
140 { | |
123 window->flags &= ~SDL_WINDOW_MINIMIZED; | 141 window->flags &= ~SDL_WINDOW_MINIMIZED; |
124 } | 142 } |
125 } | 143 } |
126 if (GetFocus() == hwnd) { | 144 if (GetFocus() == hwnd) { |
127 window->flags |= SDL_WINDOW_INPUT_FOCUS; | 145 window->flags |= SDL_WINDOW_INPUT_FOCUS; |