Mercurial > sdl-ios-xcode
comparison src/video/wincommon/SDL_sysevents.c @ 338:518ffd98a8f6
Fixed gamma ramps in DirectX windowed and OpenGL modes
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 11 Apr 2002 15:23:07 +0000 |
parents | bc4d50d2edd9 |
children | 16d0449891b8 |
comparison
equal
deleted
inserted
replaced
337:9154ec9ca3d2 | 338:518ffd98a8f6 |
---|---|
58 int mouse_relative = 0; | 58 int mouse_relative = 0; |
59 int posted = 0; | 59 int posted = 0; |
60 #ifndef NO_CHANGEDISPLAYSETTINGS | 60 #ifndef NO_CHANGEDISPLAYSETTINGS |
61 DEVMODE SDL_fullscreen_mode; | 61 DEVMODE SDL_fullscreen_mode; |
62 #endif | 62 #endif |
63 WORD *gamma_saved = NULL; | |
63 | 64 |
64 | 65 |
65 /* Functions called by the message processing function */ | 66 /* Functions called by the message processing function */ |
66 LONG | 67 LONG |
67 (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL; | 68 (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL; |
68 void (*WIN_RealizePalette)(_THIS); | 69 void (*WIN_RealizePalette)(_THIS); |
69 void (*WIN_PaletteChanged)(_THIS, HWND window); | 70 void (*WIN_PaletteChanged)(_THIS, HWND window); |
70 void (*WIN_SwapGamma)(_THIS); | |
71 void (*WIN_WinPAINT)(_THIS, HDC hdc); | 71 void (*WIN_WinPAINT)(_THIS, HDC hdc); |
72 extern void DIB_SwapGamma(_THIS); | |
72 | 73 |
73 static void SDL_RestoreGameMode(void) | 74 static void SDL_RestoreGameMode(void) |
74 { | 75 { |
75 #ifndef NO_CHANGEDISPLAYSETTINGS | 76 #ifndef NO_CHANGEDISPLAYSETTINGS |
76 ShowWindow(SDL_Window, SW_RESTORE); | 77 ShowWindow(SDL_Window, SW_RESTORE); |
196 appstate = SDL_APPACTIVE|SDL_APPINPUTFOCUS; | 197 appstate = SDL_APPACTIVE|SDL_APPINPUTFOCUS; |
197 if ( this->input_grab != SDL_GRAB_OFF ) { | 198 if ( this->input_grab != SDL_GRAB_OFF ) { |
198 WIN_GrabInput(this, SDL_GRAB_ON); | 199 WIN_GrabInput(this, SDL_GRAB_ON); |
199 } | 200 } |
200 if ( !(SDL_GetAppState()&SDL_APPINPUTFOCUS) ) { | 201 if ( !(SDL_GetAppState()&SDL_APPINPUTFOCUS) ) { |
201 WIN_SwapGamma(this); | 202 if ( ! DDRAW_FULLSCREEN() ) { |
203 DIB_SwapGamma(this); | |
204 } | |
202 if ( WINDIB_FULLSCREEN() ) { | 205 if ( WINDIB_FULLSCREEN() ) { |
203 SDL_RestoreGameMode(); | 206 SDL_RestoreGameMode(); |
204 } | 207 } |
205 } | 208 } |
206 posted = SDL_PrivateAppActive(1, appstate); | 209 posted = SDL_PrivateAppActive(1, appstate); |
213 } | 216 } |
214 if ( this->input_grab != SDL_GRAB_OFF ) { | 217 if ( this->input_grab != SDL_GRAB_OFF ) { |
215 WIN_GrabInput(this, SDL_GRAB_OFF); | 218 WIN_GrabInput(this, SDL_GRAB_OFF); |
216 } | 219 } |
217 if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) { | 220 if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) { |
218 WIN_SwapGamma(this); | 221 if ( ! DDRAW_FULLSCREEN() ) { |
222 DIB_SwapGamma(this); | |
223 } | |
219 if ( WINDIB_FULLSCREEN() ) { | 224 if ( WINDIB_FULLSCREEN() ) { |
220 SDL_RestoreDesktopMode(); | 225 SDL_RestoreDesktopMode(); |
221 } | 226 } |
222 } | 227 } |
223 posted = SDL_PrivateAppActive(0, appstate); | 228 posted = SDL_PrivateAppActive(0, appstate); |