comparison src/video/win32/SDL_win32gamma.c @ 3097:0d12e8f1de3c

Date: Thu, 05 Feb 2009 18:07:35 +0100 From: Stefan Klug Subject: [SDL] SDL 1.3 WinCE backend as promised, I've started to work on the WinCE backend of SDL 1.3 I've modified the win32 video backend and the gdi renderer, to work properly in WinCE. The results till now are great, but there is still some work to do. Attached are two patches with my changes. I would be happy if someone could review and propably commit them. The first one (configure.in.patch) should be straight forward without any side effects. The second one does the necessary changes to the win32 backend. I was really unhappy to start slicing this shiny new backend with #ifdef/#endif but I saw no other option. The most problematic issues are: - WinCe has no GetDIBits, so its practically impossible to fill a BITMAPINFO with correct values. I therefore removed the bmi member from the GDI_RenderData in SDL_gdirender.c to prevent usage of a not or not properly initialized bmi. - In SDL_win32window.c I exchanged some ASCII function by their general counterparts, (In CE only the Unicode versions are available). I don't know if this has a negative effect when running in win32 Cheers Stefan
author Sam Lantinga <slouken@libsdl.org>
date Mon, 23 Mar 2009 05:35:21 +0000
parents 99210400e8b9
children 7f684f249ec9
comparison
equal deleted inserted replaced
3096:ae4e80dbe330 3097:0d12e8f1de3c
25 25
26 26
27 int 27 int
28 WIN_SetDisplayGammaRamp(_THIS, Uint16 * ramp) 28 WIN_SetDisplayGammaRamp(_THIS, Uint16 * ramp)
29 { 29 {
30 #ifdef _WIN32_WCE
31 return -1;
32 #else
30 SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; 33 SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
31 HDC hdc; 34 HDC hdc;
32 BOOL succeeded = FALSE; 35 BOOL succeeded = FALSE;
33 36
34 hdc = CreateDC(data->DeviceName, NULL, NULL, NULL); 37 hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
38 WIN_SetError("SetDeviceGammaRamp()"); 41 WIN_SetError("SetDeviceGammaRamp()");
39 } 42 }
40 DeleteDC(hdc); 43 DeleteDC(hdc);
41 } 44 }
42 return succeeded ? 0 : -1; 45 return succeeded ? 0 : -1;
46 #endif
43 } 47 }
44 48
45 int 49 int
46 WIN_GetDisplayGammaRamp(_THIS, Uint16 * ramp) 50 WIN_GetDisplayGammaRamp(_THIS, Uint16 * ramp)
47 { 51 {
52 #ifdef _WIN32_WCE
53 return -1;
54 #else
48 SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata; 55 SDL_DisplayData *data = (SDL_DisplayData *) SDL_CurrentDisplay.driverdata;
49 HDC hdc; 56 HDC hdc;
50 BOOL succeeded = FALSE; 57 BOOL succeeded = FALSE;
51 58
52 hdc = CreateDC(data->DeviceName, NULL, NULL, NULL); 59 hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
56 WIN_SetError("GetDeviceGammaRamp()"); 63 WIN_SetError("GetDeviceGammaRamp()");
57 } 64 }
58 DeleteDC(hdc); 65 DeleteDC(hdc);
59 } 66 }
60 return succeeded ? 0 : -1; 67 return succeeded ? 0 : -1;
68 #endif
61 } 69 }
62 70
63 /* vi: set ts=4 sw=4 expandtab: */ 71 /* vi: set ts=4 sw=4 expandtab: */