summaryrefslogtreecommitdiffstats
path: root/platform/ios
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/app_delegate.mm33
-rw-r--r--platform/ios/detect.py21
-rw-r--r--platform/ios/display_server_ios.h3
-rw-r--r--platform/ios/display_server_ios.mm57
-rw-r--r--platform/ios/doc_classes/EditorExportPlatformIOS.xml5
-rw-r--r--platform/ios/export/export_plugin.cpp37
-rw-r--r--platform/ios/export/export_plugin.h10
-rw-r--r--platform/ios/godot_view.mm6
-rw-r--r--platform/ios/os_ios.mm2
-rw-r--r--platform/ios/platform_config.h2
-rw-r--r--platform/ios/platform_gl.h40
-rw-r--r--platform/ios/view_controller.mm4
12 files changed, 151 insertions, 69 deletions
diff --git a/platform/ios/app_delegate.mm b/platform/ios/app_delegate.mm
index 38846e7508..8a16f8fcc1 100644
--- a/platform/ios/app_delegate.mm
+++ b/platform/ios/app_delegate.mm
@@ -51,6 +51,15 @@ extern void ios_finish();
@implementation AppDelegate
+enum {
+ SESSION_CATEGORY_AMBIENT,
+ SESSION_CATEGORY_MULTI_ROUTE,
+ SESSION_CATEGORY_PLAY_AND_RECORD,
+ SESSION_CATEGORY_PLAYBACK,
+ SESSION_CATEGORY_RECORD,
+ SESSION_CATEGORY_SOLO_AMBIENT
+};
+
static ViewController *mainViewController = nil;
+ (ViewController *)viewController {
@@ -92,8 +101,28 @@ static ViewController *mainViewController = nil;
mainViewController = viewController;
- // prevent to stop music in another background app
- [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
+ int sessionCategorySetting = GLOBAL_GET("audio/general/ios/session_category");
+
+ // Initialize with default Ambient category.
+ AVAudioSessionCategory category = AVAudioSessionCategoryAmbient;
+
+ if (sessionCategorySetting == SESSION_CATEGORY_MULTI_ROUTE) {
+ category = AVAudioSessionCategoryMultiRoute;
+ } else if (sessionCategorySetting == SESSION_CATEGORY_PLAY_AND_RECORD) {
+ category = AVAudioSessionCategoryPlayAndRecord;
+ } else if (sessionCategorySetting == SESSION_CATEGORY_PLAYBACK) {
+ category = AVAudioSessionCategoryPlayback;
+ } else if (sessionCategorySetting == SESSION_CATEGORY_RECORD) {
+ category = AVAudioSessionCategoryRecord;
+ } else if (sessionCategorySetting == SESSION_CATEGORY_SOLO_AMBIENT) {
+ category = AVAudioSessionCategorySoloAmbient;
+ }
+
+ if (GLOBAL_GET("audio/general/ios/mix_with_others")) {
+ [[AVAudioSession sharedInstance] setCategory:category withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
+ } else {
+ [[AVAudioSession sharedInstance] setCategory:category error:nil];
+ }
return YES;
}
diff --git a/platform/ios/detect.py b/platform/ios/detect.py
index f5501e3d85..40eb61abc8 100644
--- a/platform/ios/detect.py
+++ b/platform/ios/detect.py
@@ -30,7 +30,6 @@ def get_opts():
),
("IOS_SDK_PATH", "Path to the iOS SDK", ""),
BoolVariable("ios_simulator", "Build for iOS Simulator", False),
- BoolVariable("ios_exceptions", "Enable exceptions", False),
("ios_triple", "Triple for ios toolchain", ""),
]
@@ -85,19 +84,18 @@ def configure(env: "Environment"):
env["ENV"]["PATH"] = env["IOS_TOOLCHAIN_PATH"] + "/Developer/usr/bin/:" + env["ENV"]["PATH"]
compiler_path = "$IOS_TOOLCHAIN_PATH/usr/bin/${ios_triple}"
- s_compiler_path = "$IOS_TOOLCHAIN_PATH/Developer/usr/bin/"
ccache_path = os.environ.get("CCACHE")
if ccache_path is None:
env["CC"] = compiler_path + "clang"
env["CXX"] = compiler_path + "clang++"
- env["S_compiler"] = s_compiler_path + "gcc"
+ env["S_compiler"] = compiler_path + "clang"
else:
# there aren't any ccache wrappers available for iOS,
# to enable caching we need to prepend the path to the ccache binary
env["CC"] = ccache_path + " " + compiler_path + "clang"
env["CXX"] = ccache_path + " " + compiler_path + "clang++"
- env["S_compiler"] = ccache_path + " " + s_compiler_path + "gcc"
+ env["S_compiler"] = ccache_path + " " + compiler_path + "clang"
env["AR"] = compiler_path + "ar"
env["RANLIB"] = compiler_path + "ranlib"
@@ -105,13 +103,13 @@ def configure(env: "Environment"):
if env["ios_simulator"]:
detect_darwin_sdk_path("iossimulator", env)
- env.Append(ASFLAGS=["-mios-simulator-version-min=11.0"])
- env.Append(CCFLAGS=["-mios-simulator-version-min=11.0"])
+ env.Append(ASFLAGS=["-mios-simulator-version-min=12.0"])
+ env.Append(CCFLAGS=["-mios-simulator-version-min=12.0"])
env.extra_suffix = ".simulator" + env.extra_suffix
else:
detect_darwin_sdk_path("ios", env)
- env.Append(ASFLAGS=["-miphoneos-version-min=11.0"])
- env.Append(CCFLAGS=["-miphoneos-version-min=11.0"])
+ env.Append(ASFLAGS=["-miphoneos-version-min=12.0"])
+ env.Append(CCFLAGS=["-miphoneos-version-min=12.0"])
if env["arch"] == "x86_64":
if not env["ios_simulator"]:
@@ -139,11 +137,6 @@ def configure(env: "Environment"):
env.Append(ASFLAGS=["-arch", "arm64"])
env.Append(CPPDEFINES=["NEED_LONG_INT"])
- if env["ios_exceptions"]:
- env.Append(CCFLAGS=["-fexceptions"])
- else:
- env.Append(CCFLAGS=["-fno-exceptions"])
-
# Temp fix for ABS/MAX/MIN macros in iOS SDK blocking compilation
env.Append(CCFLAGS=["-Wno-ambiguous-macro"])
@@ -161,7 +154,7 @@ def configure(env: "Environment"):
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
if env["opengl3"]:
- env.Append(CPPDEFINES=["GLES3_ENABLED"])
+ env.Append(CPPDEFINES=["GLES3_ENABLED", "GLES_SILENCE_DEPRECATION"])
env.Prepend(
CPPPATH=[
"$IOS_SDK_PATH/System/Library/Frameworks/OpenGLES.framework/Headers",
diff --git a/platform/ios/display_server_ios.h b/platform/ios/display_server_ios.h
index da16449c61..be4ea1e6ab 100644
--- a/platform/ios/display_server_ios.h
+++ b/platform/ios/display_server_ios.h
@@ -141,6 +141,9 @@ public:
virtual void tts_resume() override;
virtual void tts_stop() override;
+ virtual bool is_dark_mode_supported() const override;
+ virtual bool is_dark_mode() const override;
+
virtual Rect2i get_display_safe_area() const override;
virtual int get_screen_count() const override;
diff --git a/platform/ios/display_server_ios.mm b/platform/ios/display_server_ios.mm
index 7d91274a0c..2561c1c095 100644
--- a/platform/ios/display_server_ios.mm
+++ b/platform/ios/display_server_ios.mm
@@ -103,7 +103,7 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode
ERR_FAIL_MSG("Failed to create iOS OpenGLES rendering layer.");
}
- RasterizerGLES3::make_current();
+ RasterizerGLES3::make_current(false);
}
#endif
@@ -195,10 +195,7 @@ void DisplayServerIOS::send_window_event(DisplayServer::WindowEvent p_event) con
void DisplayServerIOS::_window_callback(const Callable &p_callable, const Variant &p_arg) const {
if (!p_callable.is_null()) {
- const Variant *argp = &p_arg;
- Variant ret;
- Callable::CallError ce;
- p_callable.callp((const Variant **)&argp, 1, ret, ce);
+ p_callable.call(p_arg);
}
}
@@ -320,54 +317,66 @@ String DisplayServerIOS::get_name() const {
}
bool DisplayServerIOS::tts_is_speaking() const {
- ERR_FAIL_COND_V_MSG(!tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+ ERR_FAIL_NULL_V_MSG(tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
return [tts isSpeaking];
}
bool DisplayServerIOS::tts_is_paused() const {
- ERR_FAIL_COND_V_MSG(!tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+ ERR_FAIL_NULL_V_MSG(tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
return [tts isPaused];
}
TypedArray<Dictionary> DisplayServerIOS::tts_get_voices() const {
- ERR_FAIL_COND_V_MSG(!tts, TypedArray<Dictionary>(), "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+ ERR_FAIL_NULL_V_MSG(tts, TypedArray<Dictionary>(), "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
return [tts getVoices];
}
void DisplayServerIOS::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int p_utterance_id, bool p_interrupt) {
- ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+ ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
[tts speak:p_text voice:p_voice volume:p_volume pitch:p_pitch rate:p_rate utterance_id:p_utterance_id interrupt:p_interrupt];
}
void DisplayServerIOS::tts_pause() {
- ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+ ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
[tts pauseSpeaking];
}
void DisplayServerIOS::tts_resume() {
- ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+ ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
[tts resumeSpeaking];
}
void DisplayServerIOS::tts_stop() {
- ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
+ ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
[tts stopSpeaking];
}
-Rect2i DisplayServerIOS::get_display_safe_area() const {
- if (@available(iOS 11, *)) {
- UIEdgeInsets insets = UIEdgeInsetsZero;
- UIView *view = AppDelegate.viewController.godotView;
- if ([view respondsToSelector:@selector(safeAreaInsets)]) {
- insets = [view safeAreaInsets];
- }
- float scale = screen_get_scale();
- Size2i insets_position = Size2i(insets.left, insets.top) * scale;
- Size2i insets_size = Size2i(insets.left + insets.right, insets.top + insets.bottom) * scale;
- return Rect2i(screen_get_position() + insets_position, screen_get_size() - insets_size);
+bool DisplayServerIOS::is_dark_mode_supported() const {
+ if (@available(iOS 13.0, *)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool DisplayServerIOS::is_dark_mode() const {
+ if (@available(iOS 13.0, *)) {
+ return [UITraitCollection currentTraitCollection].userInterfaceStyle == UIUserInterfaceStyleDark;
} else {
- return Rect2i(screen_get_position(), screen_get_size());
+ return false;
+ }
+}
+
+Rect2i DisplayServerIOS::get_display_safe_area() const {
+ UIEdgeInsets insets = UIEdgeInsetsZero;
+ UIView *view = AppDelegate.viewController.godotView;
+ if ([view respondsToSelector:@selector(safeAreaInsets)]) {
+ insets = [view safeAreaInsets];
}
+ float scale = screen_get_scale();
+ Size2i insets_position = Size2i(insets.left, insets.top) * scale;
+ Size2i insets_size = Size2i(insets.left + insets.right, insets.top + insets.bottom) * scale;
+ return Rect2i(screen_get_position() + insets_position, screen_get_size() - insets_size);
}
int DisplayServerIOS::get_screen_count() const {
diff --git a/platform/ios/doc_classes/EditorExportPlatformIOS.xml b/platform/ios/doc_classes/EditorExportPlatformIOS.xml
index 84bc0e1277..ecae6d721e 100644
--- a/platform/ios/doc_classes/EditorExportPlatformIOS.xml
+++ b/platform/ios/doc_classes/EditorExportPlatformIOS.xml
@@ -7,6 +7,7 @@
</description>
<tutorials>
<link title="Exporting for iOS">$DOCS_URL/tutorials/export/exporting_for_ios.html</link>
+ <link title="iOS plugins documentation index">$DOCS_URL/tutorials/platform/ios/index.html</link>
</tutorials>
<members>
<member name="application/app_store_team_id" type="String" setter="" getter="">
@@ -45,7 +46,7 @@
Can be overridden with the environment variable [code]GODOT_IOS_PROVISIONING_PROFILE_UUID_RELEASE[/code].
</member>
<member name="application/short_version" type="String" setter="" getter="">
- Application version visible to the user, can only contain numeric characters ([code]0-9[/code]) and periods ([code].[/code]).
+ Application version visible to the user, can only contain numeric characters ([code]0-9[/code]) and periods ([code].[/code]). Falls back to [member ProjectSettings.application/config/version] if left empty.
</member>
<member name="application/signature" type="String" setter="" getter="">
A four-character creator code that is specific to the bundle. Optional.
@@ -54,7 +55,7 @@
Supported device family.
</member>
<member name="application/version" type="String" setter="" getter="">
- Machine-readable application version, in the [code]major.minor.patch[/code] format, can only contain numeric characters ([code]0-9[/code]) and periods ([code].[/code]).
+ Machine-readable application version, in the [code]major.minor.patch[/code] format, can only contain numeric characters ([code]0-9[/code]) and periods ([code].[/code]). This must be incremented on every new release pushed to the App Store.
</member>
<member name="architectures/arm64" type="bool" setter="" getter="">
If [code]true[/code], [code]arm64[/code] binaries are included into exported project.
diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp
index 35dc058808..3cae85ea55 100644
--- a/platform/ios/export/export_plugin.cpp
+++ b/platform/ios/export/export_plugin.cpp
@@ -38,7 +38,9 @@
#include "editor/editor_node.h"
#include "editor/editor_paths.h"
#include "editor/editor_scale.h"
+#include "editor/editor_string_names.h"
#include "editor/export/editor_export.h"
+#include "editor/import/resource_importer_texture_settings.h"
#include "editor/plugins/script_editor_plugin.h"
#include "modules/modules_enabled.gen.h" // For mono and svg.
@@ -176,8 +178,8 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options)
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/bundle_identifier", PROPERTY_HINT_PLACEHOLDER_TEXT, "com.example.game"), "", false, true));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/signature"), ""));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version"), "1.0"));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version"), "1.0"));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/short_version", PROPERTY_HINT_PLACEHOLDER_TEXT, "Leave empty to use project version"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version", PROPERTY_HINT_PLACEHOLDER_TEXT, "Leave empty to use project version"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/icon_interpolation", PROPERTY_HINT_ENUM, "Nearest neighbor,Bilinear,Cubic,Trilinear,Lanczos"), 4));
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/launch_screens_interpolation", PROPERTY_HINT_ENUM, "Nearest neighbor,Bilinear,Cubic,Trilinear,Lanczos"), 4));
@@ -282,9 +284,9 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
} else if (lines[i].find("$bundle_identifier") != -1) {
strnew += lines[i].replace("$bundle_identifier", p_preset->get("application/bundle_identifier")) + "\n";
} else if (lines[i].find("$short_version") != -1) {
- strnew += lines[i].replace("$short_version", p_preset->get("application/short_version")) + "\n";
+ strnew += lines[i].replace("$short_version", p_preset->get_version("application/short_version")) + "\n";
} else if (lines[i].find("$version") != -1) {
- strnew += lines[i].replace("$version", p_preset->get("application/version")) + "\n";
+ strnew += lines[i].replace("$version", p_preset->get_version("application/version")) + "\n";
} else if (lines[i].find("$signature") != -1) {
strnew += lines[i].replace("$signature", p_preset->get("application/signature")) + "\n";
} else if (lines[i].find("$team_id") != -1) {
@@ -1925,17 +1927,19 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres
}
bool EditorExportPlatformIOS::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const {
+#if defined(MODULE_MONO_ENABLED) && !defined(MACOS_ENABLED)
+ // TODO: Remove this restriction when we don't rely on macOS tools to package up the native libraries anymore.
+ r_error += TTR("Exporting to iOS when using C#/.NET is experimental and requires macOS.") + "\n";
+ return false;
+#else
+
String err;
bool valid = false;
-#ifdef MODULE_MONO_ENABLED
- err += TTR("Exporting to iOS is currently not supported in Godot 4 when using C#/.NET. Use Godot 3 to target iOS with C#/Mono instead.") + "\n";
- err += TTR("If this project does not use C#, use a non-C# editor build to export the project.") + "\n";
- // Don't check for additional errors, as this particular error cannot be resolved.
- r_error = err;
- return false;
+#if defined(MODULE_MONO_ENABLED)
+ // iOS export is still a work in progress, keep a message as a warning.
+ err += TTR("Exporting to iOS when using C#/.NET is experimental.") + "\n";
#endif
-
// Look for export templates (first official, and if defined custom templates).
bool dvalid = exists_export_template("ios.zip", &err);
@@ -1962,6 +1966,7 @@ bool EditorExportPlatformIOS::has_valid_export_configuration(const Ref<EditorExp
}
return valid;
+#endif // !(MODULE_MONO_ENABLED && !MACOS_ENABLED)
}
bool EditorExportPlatformIOS::has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
@@ -1984,10 +1989,8 @@ bool EditorExportPlatformIOS::has_valid_project_configuration(const Ref<EditorEx
}
}
- const String etc_error = test_etc2();
- if (!etc_error.is_empty()) {
+ if (!ResourceImporterTextureSettings::should_import_etc2_astc()) {
valid = false;
- err += etc_error;
}
if (!err.is_empty()) {
@@ -2014,11 +2017,11 @@ Ref<ImageTexture> EditorExportPlatformIOS::get_option_icon(int p_index) const {
Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
if (theme.is_valid()) {
if (devices[p_index].simulator) {
- icon = theme->get_icon("IOSSimulator", "EditorIcons");
+ icon = theme->get_icon("IOSSimulator", EditorStringName(EditorIcons));
} else if (devices[p_index].wifi) {
- icon = theme->get_icon("IOSDeviceWireless", "EditorIcons");
+ icon = theme->get_icon("IOSDeviceWireless", EditorStringName(EditorIcons));
} else {
- icon = theme->get_icon("IOSDeviceWired", "EditorIcons");
+ icon = theme->get_icon("IOSDeviceWired", EditorStringName(EditorIcons));
}
}
}
diff --git a/platform/ios/export/export_plugin.h b/platform/ios/export/export_plugin.h
index 7de4c0b69d..27a4d73fcd 100644
--- a/platform/ios/export/export_plugin.h
+++ b/platform/ios/export/export_plugin.h
@@ -181,9 +181,17 @@ public:
virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const override {
List<String> list;
- list.push_back("ipa");
+ if (p_preset.is_valid()) {
+ bool project_only = p_preset->get("application/export_project_only");
+ if (project_only) {
+ list.push_back("xcodeproj");
+ } else {
+ list.push_back("ipa");
+ }
+ }
return list;
}
+
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override;
virtual bool has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug = false) const override;
diff --git a/platform/ios/godot_view.mm b/platform/ios/godot_view.mm
index 4c9a75fdc0..ff8a4f8921 100644
--- a/platform/ios/godot_view.mm
+++ b/platform/ios/godot_view.mm
@@ -82,10 +82,10 @@ static const float earth_gravity = 9.80665;
layer = [GodotMetalLayer layer];
#endif
} else if ([driverName isEqualToString:@"opengl3"]) {
- if (@available(iOS 13, *)) {
- NSLog(@"OpenGL ES is deprecated on iOS 13");
- }
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations" // OpenGL is deprecated in iOS 12.0
layer = [GodotOpenGLLayer layer];
+#pragma clang diagnostic pop
} else {
return nil;
}
diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm
index 50102e02cc..68e6d4c934 100644
--- a/platform/ios/os_ios.mm
+++ b/platform/ios/os_ios.mm
@@ -257,7 +257,7 @@ Error OS_IOS::open_dynamic_library(const String p_path, void *&p_library_handle,
}
p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW);
- ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, vformat("Can't open dynamic library: %s. Error: %s.", p_path, dlerror()));
+ ERR_FAIL_NULL_V_MSG(p_library_handle, ERR_CANT_OPEN, vformat("Can't open dynamic library: %s. Error: %s.", p_path, dlerror()));
if (r_resolved_path != nullptr) {
*r_resolved_path = path;
diff --git a/platform/ios/platform_config.h b/platform/ios/platform_config.h
index fc0e165d6b..01b0a12b5d 100644
--- a/platform/ios/platform_config.h
+++ b/platform/ios/platform_config.h
@@ -30,8 +30,6 @@
#include <alloca.h>
-#define OPENGL_INCLUDE_H <ES3/gl.h>
-
#define PTHREAD_RENAME_SELF
#define _weakify(var) __weak typeof(var) GDWeak_##var = var;
diff --git a/platform/ios/platform_gl.h b/platform/ios/platform_gl.h
new file mode 100644
index 0000000000..974ea9d2c2
--- /dev/null
+++ b/platform/ios/platform_gl.h
@@ -0,0 +1,40 @@
+/**************************************************************************/
+/* platform_gl.h */
+/**************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/**************************************************************************/
+/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
+/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/**************************************************************************/
+
+#ifndef PLATFORM_GL_H
+#define PLATFORM_GL_H
+
+#ifndef GLES_API_ENABLED
+#define GLES_API_ENABLED // Allow using GLES.
+#endif
+
+#include <ES3/gl.h>
+
+#endif // PLATFORM_GL_H
diff --git a/platform/ios/view_controller.mm b/platform/ios/view_controller.mm
index 0ef61da646..1f55670b68 100644
--- a/platform/ios/view_controller.mm
+++ b/platform/ios/view_controller.mm
@@ -161,9 +161,7 @@
[self observeKeyboard];
[self displayLoadingOverlay];
- if (@available(iOS 11.0, *)) {
- [self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
- }
+ [self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
}
- (void)observeKeyboard {