1.1 --- a/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj Fri Jun 07 21:47:23 2013 -0700
1.2 +++ b/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj Fri Jun 07 21:50:29 2013 -0700
1.3 @@ -154,13 +154,6 @@
1.4 remoteGlobalIDString = FD6526620DE8FCCB002AD96B;
1.5 remoteInfo = libSDL;
1.6 };
1.7 - 04AB757011E563D200BE9753 /* PBXContainerItemProxy */ = {
1.8 - isa = PBXContainerItemProxy;
1.9 - containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
1.10 - proxyType = 2;
1.11 - remoteGlobalIDString = 006E982211955059001DE610;
1.12 - remoteInfo = testsdl;
1.13 - };
1.14 FD1B489D0E313154007AB34E /* PBXContainerItemProxy */ = {
1.15 isa = PBXContainerItemProxy;
1.16 containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
1.17 @@ -374,7 +367,6 @@
1.18 isa = PBXGroup;
1.19 children = (
1.20 FD1B489E0E313154007AB34E /* libSDL2.a */,
1.21 - 04AB757111E563D200BE9753 /* testsdl.app */,
1.22 );
1.23 name = Products;
1.24 sourceTree = "<group>";
1.25 @@ -597,13 +589,6 @@
1.26 /* End PBXProject section */
1.27
1.28 /* Begin PBXReferenceProxy section */
1.29 - 04AB757111E563D200BE9753 /* testsdl.app */ = {
1.30 - isa = PBXReferenceProxy;
1.31 - fileType = wrapper.application;
1.32 - path = testsdl.app;
1.33 - remoteRef = 04AB757011E563D200BE9753 /* PBXContainerItemProxy */;
1.34 - sourceTree = BUILT_PRODUCTS_DIR;
1.35 - };
1.36 FD1B489E0E313154007AB34E /* libSDL2.a */ = {
1.37 isa = PBXReferenceProxy;
1.38 fileType = archive.ar;
2.1 --- a/Xcode-iOS/Demos/Info.plist Fri Jun 07 21:47:23 2013 -0700
2.2 +++ b/Xcode-iOS/Demos/Info.plist Fri Jun 07 21:50:29 2013 -0700
2.3 @@ -24,5 +24,7 @@
2.4 <string>1.0</string>
2.5 <key>NSMainNibFile</key>
2.6 <string></string>
2.7 + <key>UISupportedInterfaceOrientations</key>
2.8 + <array/>
2.9 </dict>
2.10 </plist>
3.1 --- a/Xcode-iOS/Demos/src/rectangles.c Fri Jun 07 21:47:23 2013 -0700
3.2 +++ b/Xcode-iOS/Demos/src/rectangles.c Fri Jun 07 21:50:29 2013 -0700
3.3 @@ -37,50 +37,45 @@
3.4 int
3.5 main(int argc, char *argv[])
3.6 {
3.7 -
3.8 - SDL_Window *window;
3.9 - SDL_Renderer *renderer;
3.10 - int done;
3.11 - SDL_Event event;
3.12 -
3.13 - /* initialize SDL */
3.14 - if (SDL_Init(SDL_INIT_VIDEO) < 0) {
3.15 - fatalError("Could not initialize SDL");
3.16 + if (SDL_Init(SDL_INIT_VIDEO/* | SDL_INIT_AUDIO*/) < 0)
3.17 + {
3.18 + printf("Unable to initialize SDL");
3.19 }
3.20 -
3.21 - /* seed random number generator */
3.22 - srand(time(NULL));
3.23 -
3.24 - /* create window and renderer */
3.25 - window =
3.26 - SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
3.27 - SDL_WINDOW_SHOWN);
3.28 - if (window == 0) {
3.29 - fatalError("Could not initialize Window");
3.30 +
3.31 + SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
3.32 + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
3.33 + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
3.34 +
3.35 + int landscape = 1;
3.36 + int modes = SDL_GetNumDisplayModes(0);
3.37 + int sx = 0, sy = 0;
3.38 + for (int i = 0; i < modes; i++)
3.39 + {
3.40 + SDL_DisplayMode mode;
3.41 + SDL_GetDisplayMode(0, i, &mode);
3.42 + if (landscape ? mode.w > sx : mode.h > sy)
3.43 + {
3.44 + sx = mode.w;
3.45 + sy = mode.h;
3.46 + }
3.47 }
3.48 - renderer = SDL_CreateRenderer(window, -1, 0);
3.49 - if (!renderer) {
3.50 - fatalError("Could not create renderer");
3.51 - }
3.52 -
3.53 - /* Fill screen with black */
3.54 - SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
3.55 - SDL_RenderClear(renderer);
3.56 -
3.57 - /* Enter render loop, waiting for user to quit */
3.58 - done = 0;
3.59 - while (!done) {
3.60 - while (SDL_PollEvent(&event)) {
3.61 - if (event.type == SDL_QUIT) {
3.62 - done = 1;
3.63 - }
3.64 - }
3.65 - render(renderer);
3.66 - SDL_Delay(1);
3.67 - }
3.68 -
3.69 - /* shutdown SDL */
3.70 - SDL_Quit();
3.71 +
3.72 + printf("picked: %d %d\n", sx, sy);
3.73 +
3.74 + SDL_Window *_sdl_window = NULL;
3.75 + SDL_GLContext _sdl_context = NULL;
3.76 +
3.77 + _sdl_window = SDL_CreateWindow("fred",
3.78 + 0, 0,
3.79 + sx, sy,
3.80 + SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS);
3.81 +
3.82 + SDL_SetHint("SDL_HINT_ORIENTATIONS", "LandscapeLeft LandscapeRight");
3.83 +
3.84 + int ax = 0, ay = 0;
3.85 + SDL_GetWindowSize(_sdl_window, &ax, &ay);
3.86 +
3.87 + printf("given: %d %d\n", ax, ay);
3.88
3.89 return 0;
3.90 }
4.1 --- a/configure Fri Jun 07 21:47:23 2013 -0700
4.2 +++ b/configure Fri Jun 07 21:50:29 2013 -0700
4.3 @@ -15846,7 +15846,7 @@
4.4 host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
4.5 fi
4.6 for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
4.7 - lib=`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`
4.8 + lib=`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`
4.9 if test x$lib != x; then
4.10 echo $lib
4.11 return