Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32video.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 | e70477157db9 |
children |
comparison
equal
deleted
inserted
replaced
1732:fd65f12b6de6 | 1733:0b1070f2f94d |
---|---|
82 device->driverdata = data; | 82 device->driverdata = data; |
83 | 83 |
84 #if SDL_VIDEO_RENDER_D3D | 84 #if SDL_VIDEO_RENDER_D3D |
85 data->d3dDLL = LoadLibrary(TEXT("D3D9.DLL")); | 85 data->d3dDLL = LoadLibrary(TEXT("D3D9.DLL")); |
86 if (data->d3dDLL) { | 86 if (data->d3dDLL) { |
87 IDirect3D9 *WINAPI(*D3DCreate) (UINT SDKVersion); | 87 IDirect3D9 *(WINAPI * D3DCreate) (UINT SDKVersion); |
88 | 88 |
89 D3DCreate = | 89 D3DCreate = |
90 (IDirect3D9 * WINAPI(*)(UINT)) GetProcAddress(data->d3dDLL, | 90 (IDirect3D9 * (WINAPI *) (UINT)) GetProcAddress(data->d3dDLL, |
91 "Direct3DCreate9"); | 91 "Direct3DCreate9"); |
92 if (D3DCreate) { | 92 if (D3DCreate) { |
93 data->d3d = D3DCreate(D3D_SDK_VERSION); | 93 data->d3d = D3DCreate(D3D_SDK_VERSION); |
94 } | 94 } |
95 if (!data->d3d) { | 95 if (!data->d3d) { |
96 FreeLibrary(data->d3dDLL); | 96 FreeLibrary(data->d3dDLL); |
99 } | 99 } |
100 #endif /* SDL_VIDEO_RENDER_D3D */ | 100 #endif /* SDL_VIDEO_RENDER_D3D */ |
101 | 101 |
102 /* Set the function pointers */ | 102 /* Set the function pointers */ |
103 device->VideoInit = WIN_VideoInit; | 103 device->VideoInit = WIN_VideoInit; |
104 device->GetDisplayModes = WIN_GetDisplayModes; | |
104 device->SetDisplayMode = WIN_SetDisplayMode; | 105 device->SetDisplayMode = WIN_SetDisplayMode; |
106 device->SetDisplayGammaRamp = WIN_SetDisplayGammaRamp; | |
107 device->GetDisplayGammaRamp = WIN_GetDisplayGammaRamp; | |
105 device->VideoQuit = WIN_VideoQuit; | 108 device->VideoQuit = WIN_VideoQuit; |
106 device->PumpEvents = WIN_PumpEvents; | 109 device->PumpEvents = WIN_PumpEvents; |
107 | 110 |
108 #undef CreateWindow | 111 #undef CreateWindow |
109 device->CreateWindow = WIN_CreateWindow; | 112 device->CreateWindow = WIN_CreateWindow; |