diff src/video/wincommon/SDL_sysevents.c @ 1465:8dfa9a6d69a5

Updated WinCE support by Dmitry (with some tweaks) Converted the disk audio driver to SDL_RWops for portability
author Sam Lantinga <slouken@libsdl.org>
date Sat, 04 Mar 2006 08:24:35 +0000
parents 84de7511f79f
children 4aac8563c296
line wrap: on
line diff
--- a/src/video/wincommon/SDL_sysevents.c	Sat Mar 04 05:13:03 2006 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Sat Mar 04 08:24:35 2006 +0000
@@ -40,10 +40,14 @@
 #endif
 
 #ifdef _WIN32_WCE
-#include "SDL_gapivideo.h"
+#include "../gapi/SDL_gapivideo.h"
+
+#define IsZoomed(HWND) 1
 #define NO_GETKEYBOARDSTATE
+#if _WIN32_WCE < 420
 #define NO_CHANGEDISPLAYSETTINGS
 #endif
+#endif
 
 /* The window we use for everything... */
 #ifdef _WIN32_WCE
@@ -120,6 +124,29 @@
 
 	switch(rotate) {
 		case SDL_ORIENTATION_UP:
+			{
+/* this code needs testing on a real device!
+   So it will be enabled later */
+/*
+#ifdef _WIN32_WCE
+#if _WIN32_WCE >= 420
+				// test device orientation
+				// FIXME: do not check every mouse message
+				DEVMODE settings;
+				SDL_memset(&settings, 0, sizeof(DEVMODE));
+				settings.dmSize = sizeof(DEVMODE);
+				settings.dmFields = DM_DISPLAYORIENTATION;
+				ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL);
+				if( settings.dmOrientation == DMDO_90 )
+				{
+					rotatedX = SDL_VideoSurface->h - *x;
+					rotatedY = *y;
+					*x = rotatedX;
+					*y = rotatedY;
+				}
+#endif
+#endif */
+			}
 			break;
 		case SDL_ORIENTATION_RIGHT:
 			if (!SDL_VideoSurface)
@@ -144,17 +171,21 @@
 
 static void SDL_RestoreGameMode(void)
 {
+	ShowWindow(SDL_Window, SW_RESTORE);
 #ifndef NO_CHANGEDISPLAYSETTINGS
-	ShowWindow(SDL_Window, SW_RESTORE);
+#ifndef _WIN32_WCE
 	ChangeDisplaySettings(&SDL_fullscreen_mode, CDS_FULLSCREEN);
 #endif
+#endif /* NO_CHANGEDISPLAYSETTINGS */
 }
 static void SDL_RestoreDesktopMode(void)
 {
+	ShowWindow(SDL_Window, SW_MINIMIZE);
 #ifndef NO_CHANGEDISPLAYSETTINGS
-	ShowWindow(SDL_Window, SW_MINIMIZE);
+#ifndef _WIN32_WCE
 	ChangeDisplaySettings(NULL, 0);
 #endif
+#endif /* NO_CHANGEDISPLAYSETTINGS */
 }
 
 #ifdef WM_MOUSELEAVE