summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-05 22:49:06 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-05 22:49:06 +0200
commitb7deb632513795e495e9a3aa76a9400fef4de364 (patch)
treef57006f6fee9b79aea3182df5f0c3b28e9fc71eb
parent52f3c7e158ee9436ee82f602ee9a6212dd54b776 (diff)
Experimenting with an iOS build
iPlatformApple applies to both macOS and iOS. Added iPlatformAppleDesktop and iPlatformAppleMobile to make a distinction between the two. IssueID #96
-rw-r--r--CMakeLists.txt30
-rw-r--r--Depends-iOS.cmake21
-rw-r--r--Depends.cmake20
-rw-r--r--src/app.c18
-rw-r--r--src/ios.h27
-rw-r--r--src/ios.m23
-rw-r--r--src/main.c7
-rw-r--r--src/ui/bindingswidget.c4
-rw-r--r--src/ui/documentwidget.c2
-rw-r--r--src/ui/inputwidget.c4
-rw-r--r--src/ui/window.c8
11 files changed, 131 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce07c2de..1a0e0f8f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,21 +35,7 @@ option (ENABLE_DOWNLOAD_EDIT "Allow changing the Downloads directory" ON)
35 35
36include (BuildType.cmake) 36include (BuildType.cmake)
37include (res/Embed.cmake) 37include (res/Embed.cmake)
38if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt) 38include (Depends.cmake)
39 set (INSTALL_THE_FOUNDATION YES)
40 find_package (the_Foundation REQUIRED)
41else ()
42 set (INSTALL_THE_FOUNDATION NO)
43 set (TFDN_STATIC_LIBRARY ON CACHE BOOL "")
44 set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "")
45 set (TFDN_ENABLE_TESTS OFF CACHE BOOL "")
46 set (TFDN_ENABLE_WEBREQUEST OFF CACHE BOOL "")
47 add_subdirectory (lib/the_Foundation)
48 add_library (the_Foundation::the_Foundation ALIAS the_Foundation)
49endif ()
50find_package (PkgConfig REQUIRED)
51pkg_check_modules (SDL2 REQUIRED sdl2)
52pkg_check_modules (MPG123 IMPORTED_TARGET libmpg123)
53 39
54# Embedded resources are written to a generated source file. 40# Embedded resources are written to a generated source file.
55message (STATUS "Preparing embedded resources...") 41message (STATUS "Preparing embedded resources...")
@@ -183,7 +169,10 @@ set (SOURCES
183 ${CMAKE_CURRENT_BINARY_DIR}/embedded.h 169 ${CMAKE_CURRENT_BINARY_DIR}/embedded.h
184) 170)
185if (IOS) 171if (IOS)
172 add_definitions (-DiPlatformAppleMobile=1)
173 list (APPEND SOURCES src/ios.m src/ios.h)
186elseif (APPLE) 174elseif (APPLE)
175 add_definitions (-DiPlatformAppleDesktop=1)
187 list (APPEND SOURCES src/macos.m src/macos.h) 176 list (APPEND SOURCES src/macos.m src/macos.h)
188 list (APPEND RESOURCES "res/Lagrange.icns") 177 list (APPEND RESOURCES "res/Lagrange.icns")
189endif () 178endif ()
@@ -238,13 +227,20 @@ if (APPLE)
238 else () 227 else ()
239 target_link_libraries (app PUBLIC "-framework AppKit") 228 target_link_libraries (app PUBLIC "-framework AppKit")
240 endif () 229 endif ()
241 if (CMAKE_OSX_DEPLOYMENT_TARGET) 230 if (CMAKE_OSX_DEPLOYMENT_TARGET AND NOT IOS)
242 target_compile_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}) 231 target_compile_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
243 target_link_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}) 232 target_link_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
244 endif () 233 endif ()
234 if (XCODE_DEVELOPMENT_TEAM)
235 set_property (TARGET app PROPERTY
236 XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${XCODE_DEVELOPMENT_TEAM}
237 )
238 endif ()
239 if (SDL2_LIBRARY_DIRS)
240 set_property (TARGET app PROPERTY BUILD_RPATH ${SDL2_LIBRARY_DIRS})
241 endif ()
245 set_target_properties (app PROPERTIES 242 set_target_properties (app PROPERTIES
246 OUTPUT_NAME "Lagrange" 243 OUTPUT_NAME "Lagrange"
247 BUILD_RPATH ${SDL2_LIBRARY_DIRS}
248 MACOSX_BUNDLE YES 244 MACOSX_BUNDLE YES
249 MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/res/MacOSXBundleInfo.plist.in" 245 MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/res/MacOSXBundleInfo.plist.in"
250 MACOSX_BUNDLE_BUNDLE_NAME "Lagrange" 246 MACOSX_BUNDLE_BUNDLE_NAME "Lagrange"
diff --git a/Depends-iOS.cmake b/Depends-iOS.cmake
new file mode 100644
index 00000000..013ee09a
--- /dev/null
+++ b/Depends-iOS.cmake
@@ -0,0 +1,21 @@
1message (STATUS "iOS dependency directory: ${IOS_DIR}")
2
3find_package (the_Foundation REQUIRED)
4
5set (SDL2_INCLUDE_DIRS ${IOS_DIR}/include/SDL2)
6set (SDL2_LDFLAGS
7 ${IOS_DIR}/lib/libSDL2.a
8 "-framework AudioToolbox"
9 "-framework AVFoundation"
10 "-framework CoreAudio"
11 "-framework CoreGraphics"
12 "-framework CoreHaptics"
13 "-framework CoreMotion"
14 "-framework Foundation"
15 "-framework Foundation"
16 "-framework GameController"
17 "-framework Metal"
18 "-framework OpenGLES"
19 "-framework QuartzCore"
20 "-framework UIKit"
21)
diff --git a/Depends.cmake b/Depends.cmake
new file mode 100644
index 00000000..b4dacf7c
--- /dev/null
+++ b/Depends.cmake
@@ -0,0 +1,20 @@
1if (IOS)
2 include (Depends-iOS.cmake)
3 return ()
4endif ()
5
6if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt)
7 set (INSTALL_THE_FOUNDATION YES)
8 find_package (the_Foundation REQUIRED)
9else ()
10 set (INSTALL_THE_FOUNDATION NO)
11 set (TFDN_STATIC_LIBRARY ON CACHE BOOL "")
12 set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "")
13 set (TFDN_ENABLE_TESTS OFF CACHE BOOL "")
14 set (TFDN_ENABLE_WEBREQUEST OFF CACHE BOOL "")
15 add_subdirectory (lib/the_Foundation)
16 add_library (the_Foundation::the_Foundation ALIAS the_Foundation)
17endif ()
18find_package (PkgConfig REQUIRED)
19pkg_check_modules (SDL2 REQUIRED sdl2)
20pkg_check_modules (MPG123 IMPORTED_TARGET libmpg123)
diff --git a/src/app.c b/src/app.c
index b2b0f53c..43568ba6 100644
--- a/src/app.c
+++ b/src/app.c
@@ -61,7 +61,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
61#include <stdarg.h> 61#include <stdarg.h>
62#include <errno.h> 62#include <errno.h>
63 63
64#if defined (iPlatformApple) && !defined (iPlatformIOS) 64#if defined (iPlatformAppleDesktop)
65# include "macos.h" 65# include "macos.h"
66#endif 66#endif
67#if defined (iPlatformMsys) 67#if defined (iPlatformMsys)
@@ -73,10 +73,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
73 73
74iDeclareType(App) 74iDeclareType(App)
75 75
76#if defined (iPlatformApple) 76#if defined (iPlatformAppleDesktop)
77#define EMB_BIN "../../Resources/resources.lgr" 77#define EMB_BIN "../../Resources/resources.lgr"
78static const char *defaultDataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange"; 78static const char *defaultDataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange";
79#endif 79#endif
80#if defined (iPlatformAppleMobile)
81#define EMB_BIN "../../Resources/resources.lgr"
82static const char *defaultDataDir_App_ = "~/config";
83#endif
80#if defined (iPlatformMsys) 84#if defined (iPlatformMsys)
81#define EMB_BIN "../resources.lgr" 85#define EMB_BIN "../resources.lgr"
82static const char *defaultDataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; 86static const char *defaultDataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange";
@@ -429,7 +433,7 @@ static void init_App_(iApp *d, int argc, char **argv) {
429 d->lastEventTime = 0; 433 d->lastEventTime = 0;
430 d->sleepTimer = SDL_AddTimer(1000, checkAsleep_App_, d); 434 d->sleepTimer = SDL_AddTimer(1000, checkAsleep_App_, d);
431#endif 435#endif
432#if defined (iPlatformApple) 436#if defined (iPlatformAppleDesktop)
433 setupApplication_MacOS(); 437 setupApplication_MacOS();
434#endif 438#endif
435 init_Keys(); 439 init_Keys();
@@ -628,7 +632,7 @@ void processEvents_App(enum iAppEventMode eventMode) {
628 wasUsed = processEvent_Keys(&ev); 632 wasUsed = processEvent_Keys(&ev);
629 } 633 }
630 if (ev.type == SDL_USEREVENT && ev.user.code == command_UserEventCode) { 634 if (ev.type == SDL_USEREVENT && ev.user.code == command_UserEventCode) {
631#if defined (iPlatformApple) && !defined (iPlatformIOS) 635#if defined (iPlatformAppleDesktop)
632 handleCommand_MacOS(command_UserEvent(&ev)); 636 handleCommand_MacOS(command_UserEvent(&ev));
633#endif 637#endif
634 if (isCommand_UserEvent(&ev, "metrics.changed")) { 638 if (isCommand_UserEvent(&ev, "metrics.changed")) {
@@ -1565,9 +1569,10 @@ void openInDefaultBrowser_App(const iString *url) {
1565 return; 1569 return;
1566 } 1570 }
1567#endif 1571#endif
1572#if !defined (iPlatformAppleMobile)
1568 iProcess *proc = new_Process(); 1573 iProcess *proc = new_Process();
1569 setArguments_Process(proc, 1574 setArguments_Process(proc,
1570#if defined (iPlatformApple) 1575#if defined (iPlatformAppleDesktop)
1571 iClob(newStringsCStr_StringList("/usr/bin/env", "open", cstr_String(url), NULL)) 1576 iClob(newStringsCStr_StringList("/usr/bin/env", "open", cstr_String(url), NULL))
1572#elif defined (iPlatformLinux) || defined (iPlatformOther) 1577#elif defined (iPlatformLinux) || defined (iPlatformOther)
1573 iClob(newStringsCStr_StringList("/usr/bin/env", "xdg-open", cstr_String(url), NULL)) 1578 iClob(newStringsCStr_StringList("/usr/bin/env", "xdg-open", cstr_String(url), NULL))
@@ -1581,10 +1586,11 @@ void openInDefaultBrowser_App(const iString *url) {
1581 ); 1586 );
1582 start_Process(proc); 1587 start_Process(proc);
1583 iRelease(proc); 1588 iRelease(proc);
1589#endif
1584} 1590}
1585 1591
1586void revealPath_App(const iString *path) { 1592void revealPath_App(const iString *path) {
1587#if defined (iPlatformApple) 1593#if defined (iPlatformAppleDesktop)
1588 const char *scriptPath = concatPath_CStr(dataDir_App_(), "revealfile.scpt"); 1594 const char *scriptPath = concatPath_CStr(dataDir_App_(), "revealfile.scpt");
1589 iFile *f = newCStr_File(scriptPath); 1595 iFile *f = newCStr_File(scriptPath);
1590 if (open_File(f, writeOnly_FileMode | text_FileMode)) { 1596 if (open_File(f, writeOnly_FileMode | text_FileMode)) {
diff --git a/src/ios.h b/src/ios.h
new file mode 100644
index 00000000..7217e74a
--- /dev/null
+++ b/src/ios.h
@@ -0,0 +1,27 @@
1/* Copyright 2021 Jaakko Keränen <jaakko.keranen@iki.fi>
2
3Redistribution and use in source and binary forms, with or without
4modification, are permitted provided that the following conditions are met:
5
61. Redistributions of source code must retain the above copyright notice, this
7 list of conditions and the following disclaimer.
82. Redistributions in binary form must reproduce the above copyright notice,
9 this list of conditions and the following disclaimer in the documentation
10 and/or other materials provided with the distribution.
11
12THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
13ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
16ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
22
23#pragma once
24
25#include "ui/util.h"
26
27
diff --git a/src/ios.m b/src/ios.m
new file mode 100644
index 00000000..029bd068
--- /dev/null
+++ b/src/ios.m
@@ -0,0 +1,23 @@
1/* Copyright 2021 Jaakko Keränen <jaakko.keranen@iki.fi>
2
3Redistribution and use in source and binary forms, with or without
4modification, are permitted provided that the following conditions are met:
5
61. Redistributions of source code must retain the above copyright notice, this
7 list of conditions and the following disclaimer.
82. Redistributions in binary form must reproduce the above copyright notice,
9 this list of conditions and the following disclaimer in the documentation
10 and/or other materials provided with the distribution.
11
12THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
13ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
16ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
22
23#include "ios.h"
diff --git a/src/main.c b/src/main.c
index 5e4e7284..49487bbf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,9 +22,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
22 22
23#include "app.h" 23#include "app.h"
24 24
25#if defined (iPlatformApple) 25#if defined (iPlatformAppleDesktop)
26# include "macos.h" 26# include "macos.h"
27#endif 27#endif
28#if defined (iPlatformAppleMobile)
29# include "ios.h"
30#endif
28#if defined (iPlatformMsys) 31#if defined (iPlatformMsys)
29# include "win32.h" 32# include "win32.h"
30# define SDL_MAIN_HANDLED 33# define SDL_MAIN_HANDLED
@@ -41,7 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
41int main(int argc, char **argv) { 44int main(int argc, char **argv) {
42 printf("Lagrange: A Beautiful Gemini Client\n"); 45 printf("Lagrange: A Beautiful Gemini Client\n");
43 signal(SIGPIPE, SIG_IGN); 46 signal(SIGPIPE, SIG_IGN);
44#if defined (iPlatformApple) 47#if defined (iPlatformAppleDesktop)
45 enableMomentumScroll_MacOS(); 48 enableMomentumScroll_MacOS();
46 registerURLHandler_MacOS(); 49 registerURLHandler_MacOS();
47#endif 50#endif
diff --git a/src/ui/bindingswidget.c b/src/ui/bindingswidget.c
index 9a2070ba..558bdcd5 100644
--- a/src/ui/bindingswidget.c
+++ b/src/ui/bindingswidget.c
@@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
26#include "command.h" 26#include "command.h"
27#include "util.h" 27#include "util.h"
28#include "app.h" 28#include "app.h"
29#if defined (iPlatformApple) 29#if defined (iPlatformAppleDesktop)
30# include "macos.h" 30# include "macos.h"
31#endif 31#endif
32 32
@@ -140,7 +140,7 @@ static void setActiveItem_BindingsWidget_(iBindingsWidget *d, size_t pos) {
140 item->isWaitingForEvent = iTrue; 140 item->isWaitingForEvent = iTrue;
141 invalidateItem_ListWidget(d->list, d->activePos); 141 invalidateItem_ListWidget(d->list, d->activePos);
142 } 142 }
143#if defined (iPlatformApple) 143#if defined (iPlatformAppleDesktop)
144 /* Native menus must be disabled while grabbing keys so the shortcuts don't trigger. */ 144 /* Native menus must be disabled while grabbing keys so the shortcuts don't trigger. */
145 const iBool enableNativeMenus = (d->activePos == iInvalidPos); 145 const iBool enableNativeMenus = (d->activePos == iInvalidPos);
146 enableMenu_MacOS("Edit", enableNativeMenus); 146 enableMenu_MacOS("Edit", enableNativeMenus);
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 79a77f61..38e7fcca 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -251,7 +251,7 @@ void init_DocumentWidget(iDocumentWidget *d) {
251 addChildFlags_Widget(w, 251 addChildFlags_Widget(w,
252 iClob(new_IndicatorWidget()), 252 iClob(new_IndicatorWidget()),
253 resizeToParentWidth_WidgetFlag | resizeToParentHeight_WidgetFlag); 253 resizeToParentWidth_WidgetFlag | resizeToParentHeight_WidgetFlag);
254#if !defined (iPlatformApple) /* in system menu */ 254#if !defined (iPlatformAppleDesktop) /* in system menu */
255 addAction_Widget(w, reload_KeyShortcut, "navigate.reload"); 255 addAction_Widget(w, reload_KeyShortcut, "navigate.reload");
256 addAction_Widget(w, closeTab_KeyShortcut, "tabs.close"); 256 addAction_Widget(w, closeTab_KeyShortcut, "tabs.close");
257 addAction_Widget(w, SDLK_d, KMOD_PRIMARY, "bookmark.add"); 257 addAction_Widget(w, SDLK_d, KMOD_PRIMARY, "bookmark.add");
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index 1674040b..2d767152 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
31#include <SDL_clipboard.h> 31#include <SDL_clipboard.h>
32#include <SDL_timer.h> 32#include <SDL_timer.h>
33 33
34#if defined (iPlatformApple) 34#if defined (iPlatformAppleDesktop)
35# include "macos.h" 35# include "macos.h"
36#endif 36#endif
37 37
@@ -39,7 +39,7 @@ static const int refreshInterval_InputWidget_ = 256;
39static const size_t maxUndo_InputWidget_ = 64; 39static const size_t maxUndo_InputWidget_ = 64;
40 40
41static void enableEditorKeysInMenus_(iBool enable) { 41static void enableEditorKeysInMenus_(iBool enable) {
42#if defined (iPlatformApple) 42#if defined (iPlatformAppleDesktop)
43 enableMenuItemsByKey_MacOS(SDLK_LEFT, KMOD_PRIMARY, enable); 43 enableMenuItemsByKey_MacOS(SDLK_LEFT, KMOD_PRIMARY, enable);
44 enableMenuItemsByKey_MacOS(SDLK_RIGHT, KMOD_PRIMARY, enable); 44 enableMenuItemsByKey_MacOS(SDLK_RIGHT, KMOD_PRIMARY, enable);
45#else 45#else
diff --git a/src/ui/window.c b/src/ui/window.c
index b198dd15..5c7fcaab 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
41#if defined (iPlatformMsys) 41#if defined (iPlatformMsys)
42# include "../win32.h" 42# include "../win32.h"
43#endif 43#endif
44#if defined (iPlatformApple) && !defined (iPlatformIOS) 44#if defined (iPlatformAppleDesktop)
45# include "macos.h" 45# include "macos.h"
46#endif 46#endif
47 47
@@ -92,7 +92,7 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) {
92 return iFalse; 92 return iFalse;
93} 93}
94 94
95#if defined (iPlatformApple) 95#if defined (iPlatformAppleDesktop)
96# define iHaveNativeMenus 96# define iHaveNativeMenus
97#endif 97#endif
98 98
@@ -724,8 +724,10 @@ void init_Window(iWindow *d, iRect rect) {
724 d->isMouseInside = iTrue; 724 d->isMouseInside = iTrue;
725 d->focusGainedAt = 0; 725 d->focusGainedAt = 0;
726 uint32_t flags = 0; 726 uint32_t flags = 0;
727#if defined (iPlatformApple) 727#if defined (iPlatformAppleDesktop)
728 SDL_SetHint(SDL_HINT_RENDER_DRIVER, shouldDefaultToMetalRenderer_MacOS() ? "metal" : "opengl"); 728 SDL_SetHint(SDL_HINT_RENDER_DRIVER, shouldDefaultToMetalRenderer_MacOS() ? "metal" : "opengl");
729#elif defined (iPlatformAppleMobile)
730 SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal");
729#else 731#else
730 flags |= SDL_WINDOW_OPENGL; 732 flags |= SDL_WINDOW_OPENGL;
731#endif 733#endif