diff src/video/win32/SDL_win32window.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 089a77aebb7d
children 7f684f249ec9
line wrap: on
line diff
--- a/src/video/win32/SDL_win32window.c	Mon Mar 23 05:21:40 2009 +0000
+++ b/src/video/win32/SDL_win32window.c	Mon Mar 23 05:35:21 2009 +0000
@@ -243,12 +243,14 @@
         g_hCtx[window->id] = videodata->WTOpenA(hwnd, &lc, TRUE);
     }
 
+#ifndef _WIN32_WCE /* has no RawInput */
     /* we're telling the window, we want it to report raw input events from mice */
     Rid.usUsagePage = 0x01;
     Rid.usUsage = 0x02;
     Rid.dwFlags = RIDEV_INPUTSINK;
     Rid.hwndTarget = hwnd;
     RegisterRawInputDevices(&Rid, 1, sizeof(Rid));
+#endif
 
     WIN_PumpEvents(_this);
 
@@ -360,8 +362,11 @@
             }
             SDL_FreeSurface(surface);
 
+/* TODO: create the icon in WinCE (CreateIconFromResource isn't available) */
+#ifndef _WIN32_WCE
             hicon =
                 CreateIconFromResource(icon_bmp, icon_len, TRUE, 0x00030000);
+#endif
         }
         SDL_RWclose(dst);
         SDL_stack_free(icon_bmp);
@@ -553,8 +558,8 @@
 int
 SDL_HelperWindowCreate(void)
 {
-    HINSTANCE hInstance = GetModuleHandleA(NULL);
-    WNDCLASSEX wce;
+    HINSTANCE hInstance = GetModuleHandle(NULL);
+    WNDCLASS wce;
 
     /* Make sure window isn't created twice. */
     if (SDL_HelperWindow != NULL) {
@@ -563,13 +568,12 @@
 
     /* Create the class. */
     SDL_zero(wce);
-    wce.cbSize = sizeof(WNDCLASSEX);
-    wce.lpfnWndProc = DefWindowProcA;
+    wce.lpfnWndProc = DefWindowProc;
     wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
     wce.hInstance = hInstance;
 
     /* Register the class. */
-    SDL_HelperWindowClass = RegisterClassEx(&wce);
+    SDL_HelperWindowClass = RegisterClass(&wce);
     if (SDL_HelperWindowClass == 0) {
         SDL_SetError("Unable to create Helper Window Class: error %d.",
                      GetLastError());
@@ -600,7 +604,7 @@
 void
 SDL_HelperWindowDestroy(void)
 {
-    HINSTANCE hInstance = GetModuleHandleA(NULL);
+    HINSTANCE hInstance = GetModuleHandle(NULL);
 
     /* Destroy the window. */
     if (SDL_HelperWindow != NULL) {