Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32events.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 |
---|---|
418 wmmsg.lParam = lParam; | 418 wmmsg.lParam = lParam; |
419 SDL_SendSysWMEvent(&wmmsg); | 419 SDL_SendSysWMEvent(&wmmsg); |
420 } | 420 } |
421 | 421 |
422 switch (msg) { | 422 switch (msg) { |
423 | |
424 case WM_SHOWWINDOW: | |
425 { | |
426 if (wParam) { | |
427 SDL_SendWindowEvent(data->windowID, SDL_WINDOWEVENT_SHOWN, 0, | |
428 0); | |
429 } else { | |
430 SDL_SendWindowEvent(data->windowID, SDL_WINDOWEVENT_HIDDEN, 0, | |
431 0); | |
432 } | |
433 } | |
434 break; | |
423 | 435 |
424 case WM_ACTIVATE: | 436 case WM_ACTIVATE: |
425 { | 437 { |
426 int index; | 438 int index; |
427 SDL_Keyboard *keyboard; | 439 SDL_Keyboard *keyboard; |
450 ClientToScreen(hwnd, (LPPOINT) & rect); | 462 ClientToScreen(hwnd, (LPPOINT) & rect); |
451 ClientToScreen(hwnd, (LPPOINT) & rect + 1); | 463 ClientToScreen(hwnd, (LPPOINT) & rect + 1); |
452 ClipCursor(&rect); | 464 ClipCursor(&rect); |
453 } | 465 } |
454 } | 466 } |
455 /* FIXME: Restore mode state (mode, gamma) */ | |
456 /* FIXME: Update keyboard state */ | 467 /* FIXME: Update keyboard state */ |
457 } else { | 468 } else { |
458 if (keyboard && keyboard->focus == data->windowID) { | 469 if (keyboard && keyboard->focus == data->windowID) { |
459 SDL_SetKeyboardFocus(index, 0); | 470 SDL_SetKeyboardFocus(index, 0); |
460 | 471 |
465 } | 476 } |
466 if (minimized) { | 477 if (minimized) { |
467 SDL_SendWindowEvent(data->windowID, | 478 SDL_SendWindowEvent(data->windowID, |
468 SDL_WINDOWEVENT_MINIMIZED, 0, 0); | 479 SDL_WINDOWEVENT_MINIMIZED, 0, 0); |
469 } | 480 } |
470 /* FIXME: Restore desktop state (mode, gamma) */ | |
471 } | 481 } |
472 return (0); | 482 return (0); |
473 } | 483 } |
474 break; | 484 break; |
475 | 485 |