Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32window.c @ 1733:0b1070f2f94d SDL-1.3
Implemented gamma correction on Windows.
Added general code to restore the video mode and gamma when windows lose focus.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 09 Jul 2006 09:02:26 +0000 |
parents | fd65f12b6de6 |
children | f7c667ded87d |
comparison
equal
deleted
inserted
replaced
1732:fd65f12b6de6 | 1733:0b1070f2f94d |
---|---|
20 slouken@libsdl.org | 20 slouken@libsdl.org |
21 */ | 21 */ |
22 #include "SDL_config.h" | 22 #include "SDL_config.h" |
23 | 23 |
24 #include "../SDL_sysvideo.h" | 24 #include "../SDL_sysvideo.h" |
25 #include "../../events/SDL_keyboard_c.h" | |
25 | 26 |
26 #include "SDL_win32video.h" | 27 #include "SDL_win32video.h" |
27 | 28 |
28 /* This is included after SDL_win32video.h, which includes windows.h */ | 29 /* This is included after SDL_win32video.h, which includes windows.h */ |
29 #include "SDL_syswm.h" | 30 #include "SDL_syswm.h" |
108 } | 109 } |
109 if (GetFocus() == hwnd) { | 110 if (GetFocus() == hwnd) { |
110 int index = data->videodata->keyboard; | 111 int index = data->videodata->keyboard; |
111 window->flags |= SDL_WINDOW_KEYBOARD_FOCUS; | 112 window->flags |= SDL_WINDOW_KEYBOARD_FOCUS; |
112 SDL_SetKeyboardFocus(index, data->windowID); | 113 SDL_SetKeyboardFocus(index, data->windowID); |
114 | |
115 if (window->flags & SDL_WINDOW_INPUT_GRABBED) { | |
116 RECT rect; | |
117 GetClientRect(hwnd, &rect); | |
118 ClientToScreen(hwnd, (LPPOINT) & rect); | |
119 ClientToScreen(hwnd, (LPPOINT) & rect + 1); | |
120 ClipCursor(&rect); | |
121 } | |
113 } | 122 } |
114 | 123 |
115 /* All done! */ | 124 /* All done! */ |
116 window->driverdata = data; | 125 window->driverdata = data; |
117 return 0; | 126 return 0; |