Mercurial > sdl-ios-xcode
diff 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 |
line wrap: on
line diff
--- a/src/video/win32/SDL_win32window.c Sat Jul 08 20:55:39 2006 +0000 +++ b/src/video/win32/SDL_win32window.c Sun Jul 09 09:02:26 2006 +0000 @@ -22,6 +22,7 @@ #include "SDL_config.h" #include "../SDL_sysvideo.h" +#include "../../events/SDL_keyboard_c.h" #include "SDL_win32video.h" @@ -110,6 +111,14 @@ int index = data->videodata->keyboard; window->flags |= SDL_WINDOW_KEYBOARD_FOCUS; SDL_SetKeyboardFocus(index, data->windowID); + + if (window->flags & SDL_WINDOW_INPUT_GRABBED) { + RECT rect; + GetClientRect(hwnd, &rect); + ClientToScreen(hwnd, (LPPOINT) & rect); + ClientToScreen(hwnd, (LPPOINT) & rect + 1); + ClipCursor(&rect); + } } /* All done! */