src/video/android/SDL_androidvideo.c
changeset 6555 f2c03c06d987
parent 6464 ab55284b389f
child 6654 2ecfb25be1e2
--- a/src/video/android/SDL_androidvideo.c	Wed Oct 03 20:22:14 2012 -0700
+++ b/src/video/android/SDL_androidvideo.c	Wed Oct 03 20:49:16 2012 -0700
@@ -87,17 +87,24 @@
 {
     printf("Creating video device\n");
     SDL_VideoDevice *device;
+    SDL_VideoData *data;
 
     /* Initialize all variables that we clean on shutdown */
     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
     if (!device) {
         SDL_OutOfMemory();
-        if (device) {
-            SDL_free(device);
-        }
-        return (0);
+        return NULL;
     }
 
+    data = (SDL_VideoData*) SDL_calloc(1, sizeof(SDL_VideoData));
+    if (!data) {
+        SDL_OutOfMemory();
+        SDL_free(device);
+        return NULL;
+    }
+
+    device->driverdata = data;
+
     /* Set the function pointers */
     device->VideoInit = Android_VideoInit;
     device->VideoQuit = Android_VideoQuit;
@@ -132,6 +139,11 @@
     device->GetClipboardText = Android_GetClipboardText;
     device->HasClipboardText = Android_HasClipboardText;
 
+    /* Text input */
+    device->StartTextInput = Android_StartTextInput;
+    device->StopTextInput = Android_StopTextInput;
+    device->SetTextInputRect = Android_SetTextInputRect;
+
     return device;
 }