src/video/uikit/SDL_uikitwindow.m
changeset 3400 4ec48602f1db
parent 2859 99210400e8b9
child 3685 64ce267332c6
--- a/src/video/uikit/SDL_uikitwindow.m	Tue Oct 13 20:17:11 2009 +0000
+++ b/src/video/uikit/SDL_uikitwindow.m	Sat Oct 17 07:36:45 2009 +0000
@@ -82,7 +82,7 @@
 
 int UIKit_CreateWindow(_THIS, SDL_Window *window) {
 		
-	/* iPhone applications are single window only */
+	/* We currently only handle single window applications on iPhone */
 	if (nil != [SDLUIKitDelegate sharedAppDelegate].window) {
 		SDL_SetError("Window already exists, no multi-window support.");
 		return -1;
@@ -96,7 +96,10 @@
         return -1;
     }	
 	
+	// This saves the main window in the app delegate so event callbacks can do stuff on the window.
+	// This assumes a single window application design and needs to be fixed for multiple windows.
 	[SDLUIKitDelegate sharedAppDelegate].window = uiwindow;
+	[SDLUIKitDelegate sharedAppDelegate].windowID = window->id;
 	[uiwindow release]; /* release the window (the app delegate has retained it) */
 	
 	return 1;
@@ -113,6 +116,7 @@
 
 	/* this will also destroy the window */
 	[SDLUIKitDelegate sharedAppDelegate].window = nil;
+	[SDLUIKitDelegate sharedAppDelegate].windowID = 0;
 
 }