Mercurial > sdl-ios-xcode
annotate src/video/uikit/SDL_uikitwindow.m @ 2409:8cd70487d040 gsoc2008_iphone
This is the header file for SDL_uikitview.m ... somehow this file was not committed.
author | Holmes Futrell <hfutrell@umail.ucsb.edu> |
---|---|
date | Tue, 29 Jul 2008 17:33:24 +0000 |
parents | d904584ea86d |
children | ac67f7719ba8 |
rev | line source |
---|---|
2354
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
1 /* |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
4 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
9 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
14 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
18 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
19 Sam Lantinga |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
20 slouken@libsdl.org |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
21 */ |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
22 #include "SDL_config.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
23 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
24 /* Dummy SDL video driver implementation; this is just enough to make an |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
25 * SDL-based application THINK it's got a working video driver, for |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
26 * applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it, |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
27 * and also for use as a collection of stubs when porting SDL to a new |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
28 * platform for which you haven't yet written a valid video driver. |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
29 * |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
30 * This is also a great way to determine bottlenecks: if you think that SDL |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
31 * is a performance problem for a given platform, enable this driver, and |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
32 * then see if your application runs faster without video overhead. |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
33 * |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
34 * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
35 * of this was cut-and-pasted from Stephane Peter's work in the AAlib |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
36 * SDL video driver. Renamed to "DUMMY" by Sam Lantinga. |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
37 */ |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
38 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
39 #include "SDL_video.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
40 #include "SDL_mouse.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
41 #include "../SDL_sysvideo.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
42 #include "../SDL_pixels_c.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
43 #include "../../events/SDL_events_c.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
44 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
45 #include "SDL_uikitvideo.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
46 #include "SDL_uikitevents.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
47 #include "SDL_uikitwindow.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
48 #import "SDL_uikitappdelegate.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
49 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
50 #import "SDL_uikitopenglview.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
51 #import "SDL_renderer_sw.h" |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
52 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
53 #include <UIKit/UIKit.h> |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
54 #include <Foundation/Foundation.h> |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
55 |
2399
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
56 static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created) { |
2354
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
57 |
2399
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
58 SDL_WindowData *data; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
59 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
60 /* Allocate the window data */ |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
61 data = (SDL_WindowData *)SDL_malloc(sizeof(*data)); |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
62 if (!data) { |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
63 SDL_OutOfMemory(); |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
64 return -1; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
65 } |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
66 data->windowID = window->id; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
67 data->uiwindow = uiwindow; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
68 data->view = nil; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
69 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
70 /* Fill in the SDL window with the window data */ |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
71 { |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
72 window->x = 0; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
73 window->y = 0; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
74 window->w = (int)uiwindow.frame.size.width; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
75 window->h = (int)uiwindow.frame.size.height; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
76 } |
2354
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
77 |
2399
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
78 window->driverdata = data; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
79 |
2354
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
80 window->flags &= ~SDL_WINDOW_RESIZABLE; /* window is NEVER resizeable */ |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
81 window->flags |= SDL_WINDOW_OPENGL; /* window is always OpenGL */ |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
82 window->flags |= SDL_WINDOW_FULLSCREEN; /* window is always fullscreen */ |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
83 window->flags |= SDL_WINDOW_SHOWN; /* only one window on iPod touch, always shown */ |
2399
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
84 window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */ |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
85 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
86 /* SDL_WINDOW_BORDERLESS controls whether status bar is hidden */ |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
87 if (window->flags & SDL_WINDOW_BORDERLESS) { |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
88 [UIApplication sharedApplication].statusBarHidden = YES; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
89 } |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
90 else { |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
91 [UIApplication sharedApplication].statusBarHidden = NO; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
92 } |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
93 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
94 return 0; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
95 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
96 } |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
97 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
98 int UIKit_CreateWindow(_THIS, SDL_Window *window) { |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
99 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
100 /* iPhone applications are single window only */ |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
101 if (nil != [SDLUIKitDelegate sharedAppDelegate].window) { |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
102 SDL_SetError("Window already exists, no multi-window support."); |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
103 return -1; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
104 } |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
105 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
106 /* ignore the size user requested, and make a fullscreen window */ |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
107 UIWindow *uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
108 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
109 if (SetupWindowData(_this, window, uiwindow, SDL_TRUE) < 0) { |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
110 [uiwindow release]; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
111 return -1; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
112 } |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
113 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
114 [SDLUIKitDelegate sharedAppDelegate].window = uiwindow; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
115 [uiwindow release]; /* release the window (the app delegate has retained it) */ |
2354
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
116 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
117 return 1; |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
118 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
119 } |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
120 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
121 void UIKit_DestroyWindow(_THIS, SDL_Window * window) { |
2399
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
122 /* don't worry, the delegate will automatically release the window */ |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
123 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
124 SDL_WindowData *data = (SDL_WindowData *)window->driverdata; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
125 if (data) { |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
126 SDL_free( window->driverdata ); |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
127 } |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
128 |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
129 /* this will also destroy the window */ |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
130 [SDLUIKitDelegate sharedAppDelegate].window = nil; |
d904584ea86d
Added SDL_WindowData for UIKit video driver. Now looks up instances here instead of assuming we're referring to a singleton.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2354
diff
changeset
|
131 |
2354
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
132 } |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
133 |
2e4fea4a4416
These files contain the window related functions for the UIKit video driver.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
134 /* vi: set ts=4 sw=4 expandtab: */ |