diff src/video/android/SDL_androidwindow.c @ 5001:77df56570442

Added "mouse" support for the Android touch screen
author Sam Lantinga <slouken@libsdl.org>
date Thu, 13 Jan 2011 18:31:15 -0800
parents a514bfe6952a
children c66b2a778b7e
line wrap: on
line diff
--- a/src/video/android/SDL_androidwindow.c	Thu Jan 13 18:03:56 2011 -0800
+++ b/src/video/android/SDL_androidwindow.c	Thu Jan 13 18:31:15 2011 -0800
@@ -29,6 +29,12 @@
 int
 Android_CreateWindow(_THIS, SDL_Window * window)
 {
+    if (Android_Window) {
+        SDL_SetError("Android only supports one window");
+        return -1;
+    }
+    Android_Window = window;
+
     /* Adjust the window data to match the screen */
     window->x = 0;
     window->y = 0;
@@ -47,6 +53,9 @@
 void
 Android_DestroyWindow(_THIS, SDL_Window * window)
 {
+    if (window == Android_Window) {
+        Android_Window = NULL;
+    }
 }
 
 /* vi: set ts=4 sw=4 expandtab: */