Mercurial > sdl-ios-xcode
comparison src/events/SDL_windowevents.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 | 875c3cf1a12c |
children | f7c667ded87d |
comparison
equal
deleted
inserted
replaced
1732:fd65f12b6de6 | 1733:0b1070f2f94d |
---|---|
42 case SDL_WINDOWEVENT_SHOWN: | 42 case SDL_WINDOWEVENT_SHOWN: |
43 if (window->flags & SDL_WINDOW_SHOWN) { | 43 if (window->flags & SDL_WINDOW_SHOWN) { |
44 return 0; | 44 return 0; |
45 } | 45 } |
46 window->flags |= SDL_WINDOW_SHOWN; | 46 window->flags |= SDL_WINDOW_SHOWN; |
47 SDL_OnWindowShown(window); | |
47 break; | 48 break; |
48 case SDL_WINDOWEVENT_HIDDEN: | 49 case SDL_WINDOWEVENT_HIDDEN: |
49 if (!(window->flags & SDL_WINDOW_SHOWN)) { | 50 if (!(window->flags & SDL_WINDOW_SHOWN)) { |
50 return 0; | 51 return 0; |
51 } | 52 } |
52 window->flags &= ~SDL_WINDOW_SHOWN; | 53 window->flags &= ~SDL_WINDOW_SHOWN; |
54 SDL_OnWindowHidden(window); | |
53 break; | 55 break; |
54 case SDL_WINDOWEVENT_MOVED: | 56 case SDL_WINDOWEVENT_MOVED: |
57 if (window->flags & SDL_WINDOW_FULLSCREEN) { | |
58 return 0; | |
59 } | |
55 if (data1 == window->x && data2 == window->y) { | 60 if (data1 == window->x && data2 == window->y) { |
56 return 0; | 61 return 0; |
57 } | 62 } |
58 break; | 63 break; |
59 case SDL_WINDOWEVENT_RESIZED: | 64 case SDL_WINDOWEVENT_RESIZED: |
65 if (window->flags & SDL_WINDOW_FULLSCREEN) { | |
66 return 0; | |
67 } | |
60 if (data1 == window->w && data2 == window->h) { | 68 if (data1 == window->w && data2 == window->h) { |
61 return 0; | 69 return 0; |
62 } | 70 } |
63 break; | 71 break; |
64 case SDL_WINDOWEVENT_MINIMIZED: | 72 case SDL_WINDOWEVENT_MINIMIZED: |
94 case SDL_WINDOWEVENT_FOCUS_GAINED: | 102 case SDL_WINDOWEVENT_FOCUS_GAINED: |
95 if (window->flags & SDL_WINDOW_KEYBOARD_FOCUS) { | 103 if (window->flags & SDL_WINDOW_KEYBOARD_FOCUS) { |
96 return 0; | 104 return 0; |
97 } | 105 } |
98 window->flags |= SDL_WINDOW_KEYBOARD_FOCUS; | 106 window->flags |= SDL_WINDOW_KEYBOARD_FOCUS; |
107 SDL_OnWindowFocusGained(window); | |
99 break; | 108 break; |
100 case SDL_WINDOWEVENT_FOCUS_LOST: | 109 case SDL_WINDOWEVENT_FOCUS_LOST: |
101 if (!(window->flags & SDL_WINDOW_KEYBOARD_FOCUS)) { | 110 if (!(window->flags & SDL_WINDOW_KEYBOARD_FOCUS)) { |
102 return 0; | 111 return 0; |
103 } | 112 } |
104 window->flags &= ~SDL_WINDOW_KEYBOARD_FOCUS; | 113 window->flags &= ~SDL_WINDOW_KEYBOARD_FOCUS; |
114 SDL_OnWindowFocusLost(window); | |
105 break; | 115 break; |
106 } | 116 } |
107 | 117 |
108 /* Post the event, if desired */ | 118 /* Post the event, if desired */ |
109 posted = 0; | 119 posted = 0; |