Mercurial > sdl-ios-xcode
annotate src/video/uikit/SDL_uikitvideo.m @ 2352:1ecbeff9eb4c gsoc2008_iphone
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
author | Holmes Futrell <hfutrell@umail.ucsb.edu> |
---|---|
date | Thu, 17 Jul 2008 22:38:29 +0000 |
parents | |
children | 491958a6c881 |
rev | line source |
---|---|
2352
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
1 /* |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
4 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
9 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
14 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
18 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
19 Sam Lantinga |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
20 slouken@libsdl.org |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
21 */ |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
22 #include "SDL_config.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
23 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
24 /* Dummy SDL video driver implementation; this is just enough to make an |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
25 * SDL-based application THINK it's got a working video driver, for |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
26 * applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it, |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
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 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
28 * platform for which you haven't yet written a valid video driver. |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
29 * |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
30 * This is also a great way to determine bottlenecks: if you think that SDL |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
31 * is a performance problem for a given platform, enable this driver, and |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
32 * then see if your application runs faster without video overhead. |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
33 * |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
34 * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
35 * of this was cut-and-pasted from Stephane Peter's work in the AAlib |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
36 * SDL video driver. Renamed to "DUMMY" by Sam Lantinga. |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
37 */ |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
38 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
39 #include "SDL_video.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
40 #include "SDL_mouse.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
41 #include "../SDL_sysvideo.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
42 #include "../SDL_pixels_c.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
43 #include "../../events/SDL_events_c.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
44 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
45 #include "SDL_uikitvideo.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
46 #include "SDL_uikitevents.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
47 #include "SDL_uikitwindow.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
48 #include "SDL_uikitopengles.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
49 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
50 #include "SDL_renderer_sw.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
51 #include "SDL_renderer_gles.h" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
52 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
53 #define UIKITVID_DRIVER_NAME "uikit" |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
54 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
55 /* Initialization/Query functions */ |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
56 static int UIKit_VideoInit(_THIS); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
57 static int UIKit_SetDisplayMode(_THIS, SDL_DisplayMode * mode); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
58 static void UIKit_VideoQuit(_THIS); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
59 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
60 /* DUMMY driver bootstrap functions */ |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
61 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
62 static int |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
63 UIKit_Available(void) |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
64 { |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
65 return (1); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
66 } |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
67 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
68 static void UIKit_DeleteDevice(SDL_VideoDevice * device) |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
69 { |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
70 SDL_free(device); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
71 } |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
72 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
73 static SDL_VideoDevice * |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
74 UIKit_CreateDevice(int devindex) |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
75 { |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
76 SDL_VideoDevice *device; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
77 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
78 /* Initialize all variables that we clean on shutdown */ |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
79 device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
80 if (!device) { |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
81 SDL_OutOfMemory(); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
82 if (device) { |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
83 SDL_free(device); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
84 } |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
85 return (0); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
86 } |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
87 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
88 /* Set the function pointers */ |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
89 device->VideoInit = UIKit_VideoInit; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
90 device->VideoQuit = UIKit_VideoQuit; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
91 device->SetDisplayMode = UIKit_SetDisplayMode; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
92 device->PumpEvents = UIKit_PumpEvents; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
93 device->CreateWindow = UIKit_CreateWindow; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
94 device->DestroyWindow = UIKit_DestroyWindow; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
95 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
96 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
97 /* OpenGL (ES) functions */ |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
98 device->GL_MakeCurrent = UIKit_GL_MakeCurrent; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
99 device->GL_SwapWindow = UIKit_GL_SwapWindow; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
100 device->GL_CreateContext = UIKit_GL_CreateContext; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
101 device->GL_DeleteContext = UIKit_GL_DeleteContext; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
102 device->GL_GetProcAddress = UIKit_GL_GetProcAddress; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
103 device->GL_LoadLibrary = UIKit_GL_LoadLibrary; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
104 device->free = UIKit_DeleteDevice; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
105 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
106 device->gl_config.accelerated = 1; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
107 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
108 return device; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
109 } |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
110 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
111 VideoBootStrap UIKIT_bootstrap = { |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
112 UIKITVID_DRIVER_NAME, "SDL UIKit video driver", |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
113 UIKit_Available, UIKit_CreateDevice |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
114 }; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
115 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
116 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
117 int |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
118 UIKit_VideoInit(_THIS) |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
119 { |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
120 SDL_DisplayMode mode; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
121 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
122 printf("UIKit Video init!"); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
123 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
124 _this->gl_config.driver_loaded = 1; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
125 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
126 SDL_VideoDisplay display; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
127 SDL_zero(display); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
128 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
129 /* Use a 32-bpp desktop mode */ |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
130 SDL_zero(mode); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
131 mode.format = SDL_PIXELFORMAT_ABGR8888; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
132 mode.w = 320; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
133 mode.h = 480; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
134 mode.refresh_rate = 0; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
135 mode.driverdata = NULL; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
136 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
137 display.num_display_modes = 1; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
138 display.max_display_modes = 1; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
139 display.display_modes = (SDL_DisplayMode *)SDL_malloc(display.max_display_modes * sizeof(SDL_DisplayMode)); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
140 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
141 display.display_modes[0] = mode; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
142 display.desktop_mode = mode; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
143 display.fullscreen_mode = mode; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
144 display.current_mode = mode; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
145 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
146 SDL_AddVideoDisplay(&display); |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
147 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
148 /* We're done! */ |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
149 return 0; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
150 } |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
151 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
152 static int |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
153 UIKit_SetDisplayMode(_THIS, SDL_DisplayMode * mode) |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
154 { |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
155 return 0; |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
156 } |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
157 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
158 void |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
159 UIKit_VideoQuit(_THIS) |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
160 { |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
161 } |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
162 |
1ecbeff9eb4c
SDL_uikitvideo.m is the main file for the UIKit video driver. It has the UIKit video bootstrap, initialization, device creation, etc.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff
changeset
|
163 /* vi: set ts=4 sw=4 expandtab: */ |