comparison src/video/windows/SDL_windowsgamma.c @ 5062:e8916fe9cfc8

Fixed bug #925 Changed "win32" to "windows"
author Sam Lantinga <slouken@libsdl.org>
date Thu, 20 Jan 2011 18:04:05 -0800
parents src/video/win32/SDL_win32gamma.c@f7b03b6838cb
children
comparison
equal deleted inserted replaced
5061:9e9940eae455 5062:e8916fe9cfc8
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2010 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21 */
22 #include "SDL_config.h"
23
24 #include "SDL_windowsvideo.h"
25
26
27 int
28 WIN_SetDisplayGammaRamp(_THIS, SDL_VideoDisplay * display, Uint16 * ramp)
29 {
30 #ifdef _WIN32_WCE
31 return -1;
32 #else
33 SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
34 HDC hdc;
35 BOOL succeeded = FALSE;
36
37 hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
38 if (hdc) {
39 succeeded = SetDeviceGammaRamp(hdc, ramp);
40 if (!succeeded) {
41 WIN_SetError("SetDeviceGammaRamp()");
42 }
43 DeleteDC(hdc);
44 }
45 return succeeded ? 0 : -1;
46 #endif
47 }
48
49 int
50 WIN_GetDisplayGammaRamp(_THIS, SDL_VideoDisplay * display, Uint16 * ramp)
51 {
52 #ifdef _WIN32_WCE
53 return -1;
54 #else
55 SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
56 HDC hdc;
57 BOOL succeeded = FALSE;
58
59 hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
60 if (hdc) {
61 succeeded = GetDeviceGammaRamp(hdc, ramp);
62 if (!succeeded) {
63 WIN_SetError("GetDeviceGammaRamp()");
64 }
65 DeleteDC(hdc);
66 }
67 return succeeded ? 0 : -1;
68 #endif
69 }
70
71 /* vi: set ts=4 sw=4 expandtab: */