From 434482f4432c201bda94a6d697949c1323fbdf89 Mon Sep 17 00:00:00 2001 From: Mirko Galimberti Date: Sun, 18 Apr 2021 11:24:55 +0200 Subject: [PATCH 1/2] Add support for MetalANGLE on UIKit (OpenGL ES to Metal API translation layer) --- Xcode/SDL/SDL.xcodeproj/project.pbxproj | 82 +++++++ Xcode/SDL/third-party/frameworks/.gitignore | 1 + Xcode/SDL/third-party/frameworks/README.md | 7 + include/SDL_config.h.in | 3 + src/video/SDL_sysvideo.h | 2 +- src/video/SDL_video.c | 22 +- src/video/uikit/SDL_uikitevents.m | 3 +- src/video/uikit/SDL_uikitmetalangle.h | 44 ++++ src/video/uikit/SDL_uikitmetalangle.m | 249 ++++++++++++++++++++ src/video/uikit/SDL_uikitmetalangleview.h | 61 +++++ src/video/uikit/SDL_uikitmetalangleview.m | 179 ++++++++++++++ src/video/uikit/SDL_uikitvideo.m | 3 +- src/video/uikit/SDL_uikitviewcontroller.m | 3 +- src/video/uikit/SDL_uikitwindow.m | 14 +- 14 files changed, 661 insertions(+), 12 deletions(-) create mode 100644 Xcode/SDL/third-party/frameworks/.gitignore create mode 100644 Xcode/SDL/third-party/frameworks/README.md create mode 100644 src/video/uikit/SDL_uikitmetalangle.h create mode 100644 src/video/uikit/SDL_uikitmetalangle.m create mode 100644 src/video/uikit/SDL_uikitmetalangleview.h create mode 100644 src/video/uikit/SDL_uikitmetalangleview.m diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 694bfbd5cd35e..68aafdfcd415c 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -3668,6 +3668,42 @@ AAC07105195606770073DCDF /* SDL_opengles2_khrplatform.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC070F8195606770073DCDF /* SDL_opengles2_khrplatform.h */; settings = {ATTRIBUTES = (Public, ); }; }; AAC07107195606770073DCDF /* SDL_opengles2_khrplatform.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC070F8195606770073DCDF /* SDL_opengles2_khrplatform.h */; settings = {ATTRIBUTES = (Public, ); }; }; AADA5B8716CCAB3000107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AC6A5E89262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; + AC6A5E8A262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; + AC6A5E8B262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; + AC6A5E8C262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; + AC6A5E8D262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; + AC6A5E8E262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; + AC6A5E8F262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; + AC6A5E90262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; + AC6A5E91262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; + AC6A5E92262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; + AC6A5E93262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; + AC6A5E94262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; + AC6A5E95262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; + AC6A5E96262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; + AC6A5E97262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; + AC6A5E98262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; + AC6A5E99262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; + AC6A5E9A262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; + AC6A5E9B262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; + AC6A5E9C262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; + AC6A5E9D262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; + AC6A5E9E262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; + AC6A5E9F262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; + AC6A5EA0262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; + AC6A5EA1262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; + AC6A5EA2262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; + AC6A5EA3262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; + AC6A5EA4262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; + AC6A5EA5262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; + AC6A5EA6262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; + AC6A5EA7262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; + AC6A5EA8262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; + AC6A5EA9262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; + AC6A5EAA262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; + AC6A5EAB262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; + AC6A5EAC262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; DB0F489317C400E6008798C5 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */; settings = {ATTRIBUTES = (Public, ); }; }; DB0F490C17CA57ED008798C5 /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 567E2F2017C44C35005F1892 /* SDL_filesystem.h */; settings = {ATTRIBUTES = (Public, ); }; }; DB313FC817554B71006C0E22 /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C71595D4D800BBD41B /* begin_code.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -4357,6 +4393,10 @@ AAC070F7195606770073DCDF /* SDL_opengles2_gl2platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles2_gl2platform.h; sourceTree = ""; }; AAC070F8195606770073DCDF /* SDL_opengles2_khrplatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles2_khrplatform.h; sourceTree = ""; }; AADA5B8616CCAB3000107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = ""; }; + AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmetalangleview.m; sourceTree = ""; }; + AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmetalangleview.h; sourceTree = ""; }; + AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmetalangle.h; sourceTree = ""; }; + AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmetalangle.m; sourceTree = ""; }; BECDF66B0761BA81005FE872 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = ""; }; BECDF66C0761BA81005FE872 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BECDF6B30761BA81005FE872 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -5042,6 +5082,10 @@ A7D8A62D23E2513D00DCD162 /* SDL_uikitevents.h */, A7D8A61C23E2513D00DCD162 /* SDL_uikitevents.m */, A7D8A62623E2513D00DCD162 /* SDL_uikitmessagebox.h */, + AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */, + AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */, + AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */, + AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */, A7D8A61B23E2513D00DCD162 /* SDL_uikitmessagebox.m */, A7D8A61D23E2513D00DCD162 /* SDL_uikitmetalview.h */, A7D8A62E23E2513D00DCD162 /* SDL_uikitmetalview.m */, @@ -5758,6 +5802,7 @@ A75FCD4823E25AB700529352 /* SDL_keycode.h in Headers */, A75FCD4923E25AB700529352 /* SDL_x11keyboard.h in Headers */, 5616CA63252BB35F005D5928 /* SDL_sysurl.h in Headers */, + AC6A5E99262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A75FCD4A23E25AB700529352 /* SDL_cocoakeyboard.h in Headers */, A75FCD4B23E25AB700529352 /* SDL_uikitvulkan.h in Headers */, A75FCD4C23E25AB700529352 /* SDL_x11framebuffer.h in Headers */, @@ -5767,6 +5812,7 @@ A75FCD5023E25AB700529352 /* gl2ext.h in Headers */, A75FCD5123E25AB700529352 /* SDL_clipboardevents_c.h in Headers */, A75FCD5223E25AB700529352 /* SDL_x11touch.h in Headers */, + AC6A5EA2262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A75FCD5323E25AB700529352 /* SDL_syshaptic_c.h in Headers */, A75FCD5423E25AB700529352 /* SDL_hints_c.h in Headers */, A75FCD5523E25AB700529352 /* SDL_audiodev_c.h in Headers */, @@ -6001,6 +6047,7 @@ A75FCF0123E25AC700529352 /* SDL_keycode.h in Headers */, A75FCF0223E25AC700529352 /* SDL_x11keyboard.h in Headers */, 5616CA66252BB361005D5928 /* SDL_sysurl.h in Headers */, + AC6A5E9A262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A75FCF0323E25AC700529352 /* SDL_cocoakeyboard.h in Headers */, A75FCF0423E25AC700529352 /* SDL_uikitvulkan.h in Headers */, A75FCF0523E25AC700529352 /* SDL_x11framebuffer.h in Headers */, @@ -6010,6 +6057,7 @@ A75FCF0923E25AC700529352 /* gl2ext.h in Headers */, A75FCF0A23E25AC700529352 /* SDL_clipboardevents_c.h in Headers */, A75FCF0B23E25AC700529352 /* SDL_x11touch.h in Headers */, + AC6A5EA3262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A75FCF0C23E25AC700529352 /* SDL_syshaptic_c.h in Headers */, A75FCF0D23E25AC700529352 /* SDL_hints_c.h in Headers */, A75FCF0E23E25AC700529352 /* SDL_audiodev_c.h in Headers */, @@ -6251,6 +6299,7 @@ A769B0D323E259AE00872273 /* SDL_x11video.h in Headers */, A769B0D423E259AE00872273 /* vulkan.hpp in Headers */, A769B0D623E259AE00872273 /* gl2ext.h in Headers */, + AC6A5EA0262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A769B0D723E259AE00872273 /* SDL_clipboardevents_c.h in Headers */, A769B0D823E259AE00872273 /* SDL_x11touch.h in Headers */, A769B0D923E259AE00872273 /* SDL_syshaptic_c.h in Headers */, @@ -6337,6 +6386,7 @@ A769B13F23E259AE00872273 /* SDL_offscreenframebuffer_c.h in Headers */, A769B14023E259AE00872273 /* SDL_displayevents_c.h in Headers */, A769B14123E259AE00872273 /* SDL_timer_c.h in Headers */, + AC6A5E97262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A769B14223E259AE00872273 /* gl2.h in Headers */, A769B14323E259AE00872273 /* SDL_sysmutex_c.h in Headers */, A769B14423E259AE00872273 /* scancodes_windows.h in Headers */, @@ -6421,6 +6471,7 @@ A7D8B9F023E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8BB2E23E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8B79523E2514400DCD162 /* SDL_dummyaudio.h in Headers */, + AC6A5E93262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8A96423E2514000DCD162 /* SDL_dummysensor.h in Headers */, A7D8AB0B23E2514100DCD162 /* SDL_dynapi.h in Headers */, A7D8AB1123E2514100DCD162 /* SDL_dynapi_overrides.h in Headers */, @@ -6521,6 +6572,7 @@ A7D88A5323E2437C00DCD162 /* SDL_system.h in Headers */, A7D8B3E723E2514300DCD162 /* SDL_systhread.h in Headers */, A7D8B42923E2514300DCD162 /* SDL_systhread_c.h in Headers */, + AC6A5E9C262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, 5616CA51252BB35A005D5928 /* SDL_sysurl.h in Headers */, A7D8AC4023E2514100DCD162 /* SDL_sysvideo.h in Headers */, A7D88A5423E2437C00DCD162 /* SDL_syswm.h in Headers */, @@ -6669,6 +6721,7 @@ A7D8B9F123E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8BB2F23E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8B79623E2514400DCD162 /* SDL_dummyaudio.h in Headers */, + AC6A5E94262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8A96523E2514000DCD162 /* SDL_dummysensor.h in Headers */, A7D8AB0C23E2514100DCD162 /* SDL_dynapi.h in Headers */, A7D8AB1223E2514100DCD162 /* SDL_dynapi_overrides.h in Headers */, @@ -6769,6 +6822,7 @@ A7D88C0E23E24BED00DCD162 /* SDL_system.h in Headers */, A7D8B3E823E2514300DCD162 /* SDL_systhread.h in Headers */, A7D8B42A23E2514300DCD162 /* SDL_systhread_c.h in Headers */, + AC6A5E9D262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, 5616CA54252BB35B005D5928 /* SDL_sysurl.h in Headers */, A7D8AC4123E2514100DCD162 /* SDL_sysvideo.h in Headers */, A7D88C0F23E24BED00DCD162 /* SDL_syswm.h in Headers */, @@ -6931,6 +6985,7 @@ A7D8B22223E2514200DCD162 /* SDL_x11video.h in Headers */, A7D8B27023E2514200DCD162 /* vulkan.hpp in Headers */, A7D8B22823E2514200DCD162 /* gl2ext.h in Headers */, + AC6A5E9F262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A7D8BB7323E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */, A7D8B14A23E2514200DCD162 /* SDL_x11touch.h in Headers */, A7D8AAE423E2514100DCD162 /* SDL_syshaptic_c.h in Headers */, @@ -7017,6 +7072,7 @@ A7D8AB8323E2514100DCD162 /* SDL_offscreenframebuffer_c.h in Headers */, A7D8BB4323E2514500DCD162 /* SDL_displayevents_c.h in Headers */, A7D8AB3523E2514100DCD162 /* SDL_timer_c.h in Headers */, + AC6A5E96262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8B22E23E2514200DCD162 /* gl2.h in Headers */, A7D8B44423E2514300DCD162 /* SDL_sysmutex_c.h in Headers */, A7D8BB2523E2514500DCD162 /* scancodes_windows.h in Headers */, @@ -7101,6 +7157,7 @@ A7D8B9EF23E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8BB2D23E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8B79423E2514400DCD162 /* SDL_dummyaudio.h in Headers */, + AC6A5E92262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8A96323E2514000DCD162 /* SDL_dummysensor.h in Headers */, A7D8AB0A23E2514100DCD162 /* SDL_dynapi.h in Headers */, A7D8AB1023E2514100DCD162 /* SDL_dynapi_overrides.h in Headers */, @@ -7201,6 +7258,7 @@ AA75584E1595D4D800BBD41B /* SDL_system.h in Headers */, A7D8B3E623E2514300DCD162 /* SDL_systhread.h in Headers */, A7D8B42823E2514300DCD162 /* SDL_systhread_c.h in Headers */, + AC6A5E9B262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, 5616CA4D252BB2A6005D5928 /* SDL_sysurl.h in Headers */, A7D8AC3F23E2514100DCD162 /* SDL_sysvideo.h in Headers */, AA7558501595D4D800BBD41B /* SDL_syswm.h in Headers */, @@ -7312,6 +7370,7 @@ A7D8AB8823E2514100DCD162 /* SDL_offscreenwindow.h in Headers */, A7D8A97223E2514000DCD162 /* SDL_coremotionsensor.h in Headers */, A7D8BB3023E2514500DCD162 /* SDL_dropevents_c.h in Headers */, + AC6A5E9E262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A7D8AABF23E2514100DCD162 /* SDL_haptic_c.h in Headers */, A7D8A94823E2514000DCD162 /* SDL_dataqueue.h in Headers */, A7D8A96023E2514000DCD162 /* SDL_error_c.h in Headers */, @@ -7407,6 +7466,7 @@ A7D8B1F723E2514200DCD162 /* SDL_x11dyn.h in Headers */, A7D8BB6623E2514500DCD162 /* SDL_touch_c.h in Headers */, A7D8B4AF23E2514300DCD162 /* SDL_gamecontrollerdb.h in Headers */, + AC6A5E95262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8AEEB23E2514100DCD162 /* SDL_cocoavulkan.h in Headers */, A7D8B23323E2514200DCD162 /* gl2platform.h in Headers */, A7D8B25123E2514200DCD162 /* vk_layer.h in Headers */, @@ -7563,6 +7623,7 @@ DB313FDB17554B71006C0E22 /* SDL_keycode.h in Headers */, A7D8B20B23E2514200DCD162 /* SDL_x11keyboard.h in Headers */, A7D8AE9323E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */, + AC6A5E98262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8ACE623E2514100DCD162 /* SDL_uikitvulkan.h in Headers */, A7D8B1F323E2514200DCD162 /* SDL_x11framebuffer.h in Headers */, A7D8B22323E2514200DCD162 /* SDL_x11video.h in Headers */, @@ -7572,6 +7633,7 @@ A7D8BB7423E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */, A7D8B14B23E2514200DCD162 /* SDL_x11touch.h in Headers */, A7D8AAE523E2514100DCD162 /* SDL_syshaptic_c.h in Headers */, + AC6A5EA1262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A7D8B94F23E2514400DCD162 /* SDL_hints_c.h in Headers */, A7D8B7B723E2514400DCD162 /* SDL_audiodev_c.h in Headers */, A7D8B7A523E2514400DCD162 /* SDL_audio_c.h in Headers */, @@ -8202,6 +8264,7 @@ A75FCE1323E25AB700529352 /* SDL_coreaudio.m in Sources */, A75FCE1423E25AB700529352 /* SDL_blendline.c in Sources */, A75FCE1523E25AB700529352 /* SDL_blit_A.c in Sources */, + AC6A5E90262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A75FCE1623E25AB700529352 /* SDL_d3dmath.c in Sources */, A75FCE1723E25AB700529352 /* SDL_x11mouse.c in Sources */, A75FCE1823E25AB700529352 /* SDL_nullvideo.c in Sources */, @@ -8273,6 +8336,7 @@ A75FCE5523E25AB700529352 /* SDL_blit_0.c in Sources */, A75FCE5623E25AB700529352 /* k_tan.c in Sources */, A75FCE5723E25AB700529352 /* SDL_x11vulkan.c in Sources */, + AC6A5EAB262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A75FCE5823E25AB700529352 /* SDL_diskaudio.c in Sources */, A75FCE5923E25AB700529352 /* SDL_egl.c in Sources */, A75FCE5A23E25AB700529352 /* SDL_RLEaccel.c in Sources */, @@ -8404,6 +8468,7 @@ A75FCFCC23E25AC700529352 /* SDL_coreaudio.m in Sources */, A75FCFCD23E25AC700529352 /* SDL_blendline.c in Sources */, A75FCFCE23E25AC700529352 /* SDL_blit_A.c in Sources */, + AC6A5E91262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A75FCFCF23E25AC700529352 /* SDL_d3dmath.c in Sources */, A75FCFD023E25AC700529352 /* SDL_x11mouse.c in Sources */, A75FCFD123E25AC700529352 /* SDL_nullvideo.c in Sources */, @@ -8475,6 +8540,7 @@ A75FD00E23E25AC700529352 /* SDL_blit_0.c in Sources */, A75FD00F23E25AC700529352 /* k_tan.c in Sources */, A75FD01023E25AC700529352 /* SDL_x11vulkan.c in Sources */, + AC6A5EAC262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A75FD01123E25AC700529352 /* SDL_diskaudio.c in Sources */, A75FD01223E25AC700529352 /* SDL_egl.c in Sources */, A75FD01323E25AC700529352 /* SDL_RLEaccel.c in Sources */, @@ -8629,6 +8695,7 @@ A769B19E23E259AE00872273 /* SDL_blit_A.c in Sources */, A769B19F23E259AE00872273 /* SDL_d3dmath.c in Sources */, A769B1A023E259AE00872273 /* SDL_x11mouse.c in Sources */, + AC6A5E8E262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A769B1A123E259AE00872273 /* SDL_nullvideo.c in Sources */, A769B1A223E259AE00872273 /* SDL_offscreenevents.c in Sources */, A769B1A323E259AE00872273 /* SDL_uikitview.m in Sources */, @@ -8756,6 +8823,7 @@ A769B21723E259AE00872273 /* SDL_offscreenopengl.c in Sources */, A769B21823E259AE00872273 /* SDL_uikitmetalview.m in Sources */, A769B21923E259AE00872273 /* SDL_shaders_gles2.c in Sources */, + AC6A5EA9262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A769B21A23E259AE00872273 /* SDL_blit_1.c in Sources */, A769B21B23E259AE00872273 /* SDL_x11dyn.c in Sources */, A769B21C23E259AE00872273 /* SDL_mouse.c in Sources */, @@ -8833,6 +8901,7 @@ A7D8ADF323E2514100DCD162 /* SDL_blit_A.c in Sources */, A7D8BA3823E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17723E2514200DCD162 /* SDL_x11mouse.c in Sources */, + AC6A5E8A262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8ABEC23E2514100DCD162 /* SDL_nullvideo.c in Sources */, A7D8AB6823E2514100DCD162 /* SDL_offscreenevents.c in Sources */, A7D8ACA623E2514100DCD162 /* SDL_uikitview.m in Sources */, @@ -8904,6 +8973,7 @@ A7D8B15F23E2514200DCD162 /* SDL_x11vulkan.c in Sources */, A7D8B8A923E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC123E2514200DCD162 /* SDL_egl.c in Sources */, + AC6A5EA5262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8AC3423E2514100DCD162 /* SDL_RLEaccel.c in Sources */, A7D8BBB223E2514500DCD162 /* SDL_assert.c in Sources */, A7D8B3DB23E2514300DCD162 /* SDL_bmp.c in Sources */, @@ -9035,6 +9105,7 @@ A7D8ADF423E2514100DCD162 /* SDL_blit_A.c in Sources */, A7D8BA3923E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17823E2514200DCD162 /* SDL_x11mouse.c in Sources */, + AC6A5E8B262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8ABED23E2514100DCD162 /* SDL_nullvideo.c in Sources */, A7D8AB6923E2514100DCD162 /* SDL_offscreenevents.c in Sources */, A7D8ACA723E2514100DCD162 /* SDL_uikitview.m in Sources */, @@ -9106,6 +9177,7 @@ A75FDBD023EA380300529352 /* SDL_hidapi_rumble.c in Sources */, A7D8B8AA23E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC223E2514200DCD162 /* SDL_egl.c in Sources */, + AC6A5EA6262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8AC3523E2514100DCD162 /* SDL_RLEaccel.c in Sources */, A7D8BBB323E2514500DCD162 /* SDL_assert.c in Sources */, A7D8B3DC23E2514300DCD162 /* SDL_bmp.c in Sources */, @@ -9236,6 +9308,7 @@ A7D8ADF623E2514100DCD162 /* SDL_blit_A.c in Sources */, A7D8BA3B23E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17A23E2514200DCD162 /* SDL_x11mouse.c in Sources */, + AC6A5E8D262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8ABEF23E2514100DCD162 /* SDL_nullvideo.c in Sources */, A7D8AB6B23E2514100DCD162 /* SDL_offscreenevents.c in Sources */, A7D8ACA923E2514100DCD162 /* SDL_uikitview.m in Sources */, @@ -9363,6 +9436,7 @@ A7D8AB5923E2514100DCD162 /* SDL_offscreenopengl.c in Sources */, A7D8ACC723E2514100DCD162 /* SDL_uikitmetalview.m in Sources */, A7D8BA5F23E2514400DCD162 /* SDL_shaders_gles2.c in Sources */, + AC6A5EA8262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8B14423E2514200DCD162 /* SDL_blit_1.c in Sources */, A7D8B18023E2514200DCD162 /* SDL_x11dyn.c in Sources */, A7D8BB1923E2514500DCD162 /* SDL_mouse.c in Sources */, @@ -9440,6 +9514,7 @@ A7D8BA1F23E2514400DCD162 /* SDL_blendline.c in Sources */, A7D8BBE723E2574800DCD162 /* SDL_uikitviewcontroller.m in Sources */, A7D8ADF223E2514100DCD162 /* SDL_blit_A.c in Sources */, + AC6A5E89262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8BBDD23E2574800DCD162 /* SDL_uikitmodes.m in Sources */, A7D8BA3723E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17623E2514200DCD162 /* SDL_x11mouse.c in Sources */, @@ -9511,6 +9586,7 @@ A7D8ADE623E2514100DCD162 /* SDL_blit_0.c in Sources */, A7D8BB0923E2514500DCD162 /* k_tan.c in Sources */, A7D8B15E23E2514200DCD162 /* SDL_x11vulkan.c in Sources */, + AC6A5EA4262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8B8A823E2514400DCD162 /* SDL_diskaudio.c in Sources */, 566E26CF246274CC00718109 /* SDL_syslocale.m in Sources */, A7D8AFC023E2514200DCD162 /* SDL_egl.c in Sources */, @@ -9642,6 +9718,7 @@ A7D8B53C23E2514300DCD162 /* SDL_hidapi_xbox360.c in Sources */, A7D8B8D523E2514400DCD162 /* SDL_coreaudio.m in Sources */, A7D8BA2223E2514400DCD162 /* SDL_blendline.c in Sources */, + AC6A5E8C262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8BC0623E2574800DCD162 /* SDL_uikitwindow.m in Sources */, A7D8ADF523E2514100DCD162 /* SDL_blit_A.c in Sources */, A7D8BA3A23E2514400DCD162 /* SDL_d3dmath.c in Sources */, @@ -9713,6 +9790,7 @@ A7D8BBF223E2574800DCD162 /* SDL_uikitevents.m in Sources */, A7D8B16123E2514200DCD162 /* SDL_x11vulkan.c in Sources */, A7D8BBB923E2560500DCD162 /* SDL_steamcontroller.c in Sources */, + AC6A5EA7262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8B8AB23E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC323E2514200DCD162 /* SDL_egl.c in Sources */, A7D8AC3623E2514100DCD162 /* SDL_RLEaccel.c in Sources */, @@ -9844,6 +9922,7 @@ A7D8B8D723E2514400DCD162 /* SDL_coreaudio.m in Sources */, A7D8BA2423E2514400DCD162 /* SDL_blendline.c in Sources */, A7D8ADF723E2514100DCD162 /* SDL_blit_A.c in Sources */, + AC6A5E8F262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8BA3C23E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17B23E2514200DCD162 /* SDL_x11mouse.c in Sources */, A7D8ABF023E2514100DCD162 /* SDL_nullvideo.c in Sources */, @@ -9915,6 +9994,7 @@ A7D8ADEB23E2514100DCD162 /* SDL_blit_0.c in Sources */, A7D8BB0E23E2514500DCD162 /* k_tan.c in Sources */, A7D8B16323E2514200DCD162 /* SDL_x11vulkan.c in Sources */, + AC6A5EAA262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8B8AD23E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC523E2514200DCD162 /* SDL_egl.c in Sources */, A7D8AC3823E2514100DCD162 /* SDL_RLEaccel.c in Sources */, @@ -10037,6 +10117,7 @@ DYLIB_CURRENT_VERSION = 15.1.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = "./third-party/frameworks"; GCC_ALTIVEC_EXTENSIONS = YES; GCC_AUTO_VECTORIZATION = YES; GCC_ENABLE_SSE3_EXTENSIONS = YES; @@ -10121,6 +10202,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = "./third-party/frameworks"; GCC_ALTIVEC_EXTENSIONS = YES; GCC_AUTO_VECTORIZATION = YES; GCC_ENABLE_SSE3_EXTENSIONS = YES; diff --git a/Xcode/SDL/third-party/frameworks/.gitignore b/Xcode/SDL/third-party/frameworks/.gitignore new file mode 100644 index 0000000000000..06dacc560b261 --- /dev/null +++ b/Xcode/SDL/third-party/frameworks/.gitignore @@ -0,0 +1 @@ +*.framework \ No newline at end of file diff --git a/Xcode/SDL/third-party/frameworks/README.md b/Xcode/SDL/third-party/frameworks/README.md new file mode 100644 index 0000000000000..d5da455e40041 --- /dev/null +++ b/Xcode/SDL/third-party/frameworks/README.md @@ -0,0 +1,7 @@ +# Why this folder is here? + +SDL Xcode project is using this folder for managing third-party components (like external Frameworks) that are needed during the build phase. + +### Usage: + +If you're building **SDL** with **MetalANGLE** support, just copy + paste your `MetalANGLE.framework` here. \ No newline at end of file diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 9ddd932e3779f..90ad8175a04bc 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -424,6 +424,9 @@ /* Enable Metal support */ #undef SDL_VIDEO_METAL +/* Enable MetalANGLE support */ +#undef SDL_VIDEO_METALANGLE + /* Enable system power support */ #undef SDL_POWER_LINUX #undef SDL_POWER_WINDOWS diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 682e52592921b..e933729f5d677 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -402,7 +402,7 @@ struct SDL_VideoDevice struct SDL_EGL_VideoData *egl_data; #endif -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE struct SDL_PrivateGLESData *gles_data; #endif diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index a5cbe69629e41..9cae85b73edc6 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -46,6 +46,14 @@ #include "SDL_opengles2.h" #endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */ +#if SDL_VIDEO_METALANGLE +#include +#include +#ifndef APIENTRY +#define APIENTRY GL_APIENTRY +#endif +#endif /* SDL_VIDEO_METALANGLE */ + #if !SDL_VIDEO_OPENGL #ifndef GL_CONTEXT_RELEASE_BEHAVIOR_KHR #define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB @@ -247,7 +255,7 @@ ShouldUseTextureFramebuffer() } return hasAcceleratedOpenGL; } -#elif SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#elif SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE /* Let's be optimistic about this! */ return SDL_TRUE; #else @@ -3158,7 +3166,7 @@ SDL_GL_UnloadLibrary(void) } } -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE static SDL_INLINE SDL_bool isAtLeastGL3(const char *verstr) { @@ -3169,7 +3177,7 @@ isAtLeastGL3(const char *verstr) SDL_bool SDL_GL_ExtensionSupported(const char *extension) { -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE const GLubyte *(APIENTRY * glGetStringFunc) (GLenum); const char *extensions; const char *start; @@ -3261,7 +3269,7 @@ SDL_GL_DeduceMaxSupportedESProfile(int* major, int* minor) { /* THIS REQUIRES AN EXISTING GL CONTEXT THAT HAS BEEN MADE CURRENT. */ /* Please refer to https://bugzilla.libsdl.org/show_bug.cgi?id=3725 for discussion. */ -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE /* XXX This is fragile; it will break in the event of release of * new versions of OpenGL ES. */ @@ -3310,7 +3318,7 @@ SDL_GL_ResetAttributes() _this->gl_config.major_version = 2; _this->gl_config.minor_version = 1; _this->gl_config.profile_mask = 0; -#elif SDL_VIDEO_OPENGL_ES2 +#elif SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE _this->gl_config.major_version = 2; _this->gl_config.minor_version = 0; _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; @@ -3338,7 +3346,7 @@ SDL_GL_ResetAttributes() int SDL_GL_SetAttribute(SDL_GLattr attr, int value) { -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE int retval; if (!_this) { @@ -3459,7 +3467,7 @@ SDL_GL_SetAttribute(SDL_GLattr attr, int value) int SDL_GL_GetAttribute(SDL_GLattr attr, int *value) { -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE GLenum (APIENTRY *glGetErrorFunc) (void); GLenum attrib = 0; GLenum error = 0; diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index 4219164c34dbf..40ddf42ce1baf 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -27,6 +27,7 @@ #include "SDL_uikitvideo.h" #include "SDL_uikitevents.h" #include "SDL_uikitopengles.h" +#include "SDL_uikitmetalangle.h" #import @@ -72,7 +73,7 @@ touch events to get processed (which is important to get certain } while(result == kCFRunLoopRunHandledSource); /* See the comment in the function definition. */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE UIKit_GL_RestoreCurrentContext(); #endif } diff --git a/src/video/uikit/SDL_uikitmetalangle.h b/src/video/uikit/SDL_uikitmetalangle.h new file mode 100644 index 0000000000000..71c2bbd128c9b --- /dev/null +++ b/src/video/uikit/SDL_uikitmetalangle.h @@ -0,0 +1,44 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2021 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef SDL_uikitmetalangle_ +#define SDL_uikitmetalangle_ + +#if SDL_VIDEO_METALANGLE + +#include "../SDL_sysvideo.h" + +extern int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, + SDL_GLContext context); +extern void UIKit_GL_GetDrawableSize(_THIS, SDL_Window * window, + int * w, int * h); +extern int UIKit_GL_SwapWindow(_THIS, SDL_Window * window); +extern SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window); +extern void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context); +extern void *UIKit_GL_GetProcAddress(_THIS, const char *proc); +extern int UIKit_GL_LoadLibrary(_THIS, const char *path); + +extern void UIKit_GL_RestoreCurrentContext(void); + +#endif SDL_VIDEO_METALANGLE + +#endif /* SDL_uikitmetalangle_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/uikit/SDL_uikitmetalangle.m b/src/video/uikit/SDL_uikitmetalangle.m new file mode 100644 index 0000000000000..97bb4171d5aa1 --- /dev/null +++ b/src/video/uikit/SDL_uikitmetalangle.m @@ -0,0 +1,249 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2021 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../../SDL_internal.h" + +#if SDL_VIDEO_DRIVER_UIKIT && SDL_VIDEO_METALANGLE + +#include "SDL_uikitmetalangle.h" +#import "SDL_uikitmetalangleview.h" +#include "SDL_uikitmodes.h" +#include "SDL_uikitwindow.h" +#include "SDL_uikitevents.h" +#include "../SDL_sysvideo.h" +#include "../../events/SDL_keyboard_c.h" +#include "../../events/SDL_mouse_c.h" +#include "../../power/uikit/SDL_syspower.h" +#include "SDL_loadso.h" +#include + +@interface SDLEAGLContext : MGLContext + +/* The OpenGL ES context owns a view / drawable. */ +@property (nonatomic, strong) SDL_uikitmetalangleview *sdlView; + +@end + +@implementation SDLEAGLContext + +- (void)dealloc +{ + /* When the context is deallocated, its view should be removed from any + * SDL window that it's attached to. */ + [self.sdlView setSDLWindow:NULL]; +} + +@end + +void * +UIKit_GL_GetProcAddress(_THIS, const char *proc) +{ + /* Look through all SO's for the proc symbol. Here's why: + * -Looking for the path to the OpenGL Library seems not to work in the iOS Simulator. + * -We don't know that the path won't change in the future. */ + return dlsym(RTLD_DEFAULT, proc); +} + +/* + note that SDL_GL_DeleteContext makes it current without passing the window +*/ +int +UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +{ + @autoreleasepool { + SDLEAGLContext *eaglcontext = (__bridge SDLEAGLContext *) context; + + if (![MGLContext setCurrentContext:eaglcontext forLayer:(MGLLayer*)eaglcontext.sdlView.layer]) { + return SDL_SetError("Could not make EAGL context current"); + } + + if (eaglcontext) { + [eaglcontext.sdlView setSDLWindow:window]; + } + } + + return 0; +} + +void +UIKit_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) +{ + @autoreleasepool { + SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; + UIView *view = data.viewcontroller.view; + if ([view isKindOfClass:[SDL_uikitmetalangleview class]]) { + SDL_uikitmetalangleview *glview = (SDL_uikitmetalangleview *) view; + if (w) { + *w = glview.backingWidth; + } + if (h) { + *h = glview.backingHeight; + } + } else { + SDL_GetWindowSize(window, w, h); + } + } +} + +int +UIKit_GL_LoadLibrary(_THIS, const char *path) +{ + /* We shouldn't pass a path to this function, since we've already loaded the + * library. */ + if (path != NULL) { + return SDL_SetError("iOS GL Load Library just here for compatibility"); + } + return 0; +} + +int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) +{ + @autoreleasepool { + SDLEAGLContext *context = (__bridge SDLEAGLContext *) SDL_GL_GetCurrentContext(); + +#if SDL_POWER_UIKIT + /* Check once a frame to see if we should turn off the battery monitor. */ + SDL_UIKit_UpdateBatteryMonitoring(); +#endif + + [context.sdlView swapBuffers]; + + /* You need to pump events in order for the OS to make changes visible. + * We don't pump events here because we don't want iOS application events + * (low memory, terminate, etc.) to happen inside low level rendering. */ + } + return 0; +} + +SDL_GLContext +UIKit_GL_CreateContext(_THIS, SDL_Window * window) +{ + @autoreleasepool { + SDLEAGLContext *context = nil; + SDL_uikitmetalangleview *view; + SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; + CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen); + MGLSharegroup *sharegroup = nil; + CGFloat scale = 1.0; + int samples = 0; + int major = _this->gl_config.major_version; + int minor = _this->gl_config.minor_version; + + /* The EAGLRenderingAPI enum values currently map 1:1 to major GLES + * versions. */ + MGLRenderingAPI api = major; + + /* iOS currently doesn't support GLES >3.0. iOS 6 also only supports up + * to GLES 2.0. */ + if (major > 3 || (major == 3 && (minor > 0 || !UIKit_IsSystemVersionAtLeast(7.0)))) { + SDL_SetError("OpenGL ES %d.%d context could not be created", major, minor); + return NULL; + } + + if (_this->gl_config.multisamplebuffers > 0) { + samples = _this->gl_config.multisamplesamples; + } + + if (_this->gl_config.share_with_current_context) { + MGLContext *context = (__bridge MGLContext *) SDL_GL_GetCurrentContext(); + sharegroup = context.sharegroup; + } + + if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { + /* Set the scale to the natural scale factor of the screen - the + * backing dimensions of the OpenGL view will match the pixel + * dimensions of the screen rather than the dimensions in points. */ + if ([data.uiwindow.screen respondsToSelector:@selector(nativeScale)]) { + scale = data.uiwindow.screen.nativeScale; + } else { + scale = data.uiwindow.screen.scale; + } + } + + context = [[SDLEAGLContext alloc] initWithAPI:api sharegroup:sharegroup]; + if (!context || ![MGLContext setCurrentContext:context]) { + SDL_SetError("OpenGL ES %d context could not be created", _this->gl_config.major_version); + return NULL; + } + + /* construct our view, passing in SDL's OpenGL configuration data */ + view = [[SDL_uikitmetalangleview alloc] initWithFrame:frame + scale:scale + retainBacking:_this->gl_config.retained_backing + rBits:_this->gl_config.red_size + gBits:_this->gl_config.green_size + bBits:_this->gl_config.blue_size + aBits:_this->gl_config.alpha_size + depthBits:_this->gl_config.depth_size + stencilBits:_this->gl_config.stencil_size + sRGB:_this->gl_config.framebuffer_srgb_capable + multisamples:samples + context:context]; + + if (!view) { + return NULL; + } + + /* The context owns the view / drawable. */ + context.sdlView = view; + + if (UIKit_GL_MakeCurrent(_this, window, (__bridge SDL_GLContext) context) < 0) { + UIKit_GL_DeleteContext(_this, (SDL_GLContext) CFBridgingRetain(context)); + return NULL; + } + + /* We return a +1'd context. The window's driverdata owns the view (via + * MakeCurrent.) */ + return (SDL_GLContext) CFBridgingRetain(context); + } +} + +void +UIKit_GL_DeleteContext(_THIS, SDL_GLContext context) +{ + @autoreleasepool { + /* The context was retained in SDL_GL_CreateContext, so we release it + * here. The context's view will be detached from its window when the + * context is deallocated. */ + CFRelease(context); + } +} + +void +UIKit_GL_RestoreCurrentContext(void) +{ + @autoreleasepool { + /* Some iOS system functionality (such as Dictation on the on-screen + keyboard) uses its own OpenGL ES context but doesn't restore the + previous one when it's done. This is a workaround to make sure the + expected SDL-created OpenGL ES context is active after the OS is + finished running its own code for the frame. If this isn't done, the + app may crash or have other nasty symptoms when Dictation is used. + */ + MGLContext *context = (__bridge MGLContext *) SDL_GL_GetCurrentContext(); + if (context != NULL && [MGLContext currentContext] != context) { + [MGLContext setCurrentContext:context]; + } + } +} + +#endif /* SDL_VIDEO_DRIVER_UIKIT */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/uikit/SDL_uikitmetalangleview.h b/src/video/uikit/SDL_uikitmetalangleview.h new file mode 100644 index 0000000000000..2c017fb38aac3 --- /dev/null +++ b/src/video/uikit/SDL_uikitmetalangleview.h @@ -0,0 +1,61 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2021 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#if SDL_VIDEO_METALANGLE + +#import +#import + +#import "SDL_uikitview.h" +#include "SDL_uikitvideo.h" + +@interface SDL_uikitmetalangleview : SDL_uikitview + +- (instancetype)initWithFrame:(CGRect)frame + scale:(CGFloat)scale + retainBacking:(BOOL)retained + rBits:(int)rBits + gBits:(int)gBits + bBits:(int)bBits + aBits:(int)aBits + depthBits:(int)depthBits + stencilBits:(int)stencilBits + sRGB:(BOOL)sRGB + multisamples:(int)multisamples + context:(MGLContext *)glcontext; + +@property (nonatomic, readonly, weak) MGLContext *context; + +/* The width and height of the drawable in pixels (as opposed to points.) */ +@property (nonatomic, readonly) int backingWidth; +@property (nonatomic, readonly) int backingHeight; + +@property (nonatomic, readonly) GLuint drawableRenderbuffer; +@property (nonatomic, readonly) GLuint drawableFramebuffer; +@property (nonatomic, readonly) GLuint msaaResolveFramebuffer; + +- (void)swapBuffers; + +@end + +#endif // SDL_VIDEO_METALANGLE + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/uikit/SDL_uikitmetalangleview.m b/src/video/uikit/SDL_uikitmetalangleview.m new file mode 100644 index 0000000000000..1712cb99e16b9 --- /dev/null +++ b/src/video/uikit/SDL_uikitmetalangleview.m @@ -0,0 +1,179 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2021 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../../SDL_internal.h" + +#if SDL_VIDEO_DRIVER_UIKIT && SDL_VIDEO_METALANGLE + +#import +#import +#import +#import +#import "SDL_uikitmetalangleview.h" +#include "SDL_uikitwindow.h" + +@implementation SDL_uikitmetalangleview { + /* The renderbuffer and framebuffer used to render to this layer. */ + GLuint viewRenderbuffer, viewFramebuffer; + + /* format of depthRenderbuffer */ + GLenum depthBufferFormat; + + /* The number of MSAA samples. */ + int samples; + + BOOL retainedBacking; +} + +@synthesize context; +@synthesize backingWidth; +@synthesize backingHeight; + ++ (Class)layerClass +{ + return [MGLLayer class]; +} + +- (instancetype)initWithFrame:(CGRect)frame + scale:(CGFloat)scale + retainBacking:(BOOL)retained + rBits:(int)rBits + gBits:(int)gBits + bBits:(int)bBits + aBits:(int)aBits + depthBits:(int)depthBits + stencilBits:(int)stencilBits + sRGB:(BOOL)sRGB + multisamples:(int)multisamples + context:(MGLContext *)glcontext +{ + if ((self = [super initWithFrame:frame])) { + const BOOL useStencilBuffer = (stencilBits != 0); + const BOOL useDepthBuffer = (depthBits != 0); + int colorFormat; + + context = glcontext; + samples = multisamples; + retainedBacking = retained; + + MGLLayer *eaglLayer = (MGLLayer *)self.layer; + + if (samples > 0) { + GLint maxsamples = 0; + glGetIntegerv(GL_MAX_SAMPLES, &maxsamples); + + /* Clamp the samples to the max supported count. */ + samples = MIN(samples, maxsamples); + } + + if (sRGB) { + colorFormat = MGLDrawableColorFormatSRGBA8888; + } else if (rBits >= 8 || gBits >= 8 || bBits >= 8 || aBits > 0) { + /* if user specifically requests rbg888 or some color format higher than 16bpp */ + colorFormat = MGLDrawableColorFormatRGBA8888; + } else { + /* default case (potentially faster) */ + colorFormat = MGLDrawableColorFormatRGB565; + } + + eaglLayer.opaque = YES; + eaglLayer.drawableColorFormat = colorFormat; + eaglLayer.retainedBacking = retained; + + /* Set the appropriate scale (for retina display support) */ + self.contentScaleFactor = scale; + eaglLayer.contentsScale = scale; + + if (!context || ![MGLContext setCurrentContext:context]) { + SDL_SetError("Could not create OpenGL ES drawable (could not make context current)"); + return nil; + } + + viewFramebuffer = eaglLayer.defaultOpenGLFrameBufferID; + backingWidth = eaglLayer.drawableSize.width; + backingHeight = eaglLayer.drawableSize.height; + + if (samples > 0) { + eaglLayer.drawableMultisample = samples; + } + + if (useDepthBuffer || useStencilBuffer) { + if (useDepthBuffer) { + eaglLayer.drawableDepthFormat = MGLDrawableDepthFormat16; + } + if (useStencilBuffer) { + eaglLayer.drawableStencilFormat = MGLDrawableStencilFormat8; + } + } + } + + return self; +} + +- (GLuint)drawableRenderbuffer +{ + return viewFramebuffer; +} + +- (GLuint)drawableFramebuffer +{ + return viewFramebuffer; +} + +- (GLuint)msaaResolveFramebuffer +{ + return viewFramebuffer; +} + +- (void)swapBuffers +{ + MGLLayer *eaglLayer = (MGLLayer *)self.layer; + [MGLContext setCurrentContext:context forLayer:eaglLayer]; + [context present:eaglLayer]; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + + int width = (int) (self.bounds.size.width * self.contentScaleFactor); + int height = (int) (self.bounds.size.height * self.contentScaleFactor); + + /* Update the backingWidth and backingHeight if the layer size has changed. */ + if (width != backingWidth || height != backingHeight) { + MGLLayer *eaglLayer = (MGLLayer *)self.layer; + [MGLContext setCurrentContext:context forLayer:eaglLayer]; + backingWidth = eaglLayer.drawableSize.width; + backingHeight = eaglLayer.drawableSize.height; + } +} + +- (void)dealloc +{ + if (context && context == [MGLContext currentContext]) { + [MGLContext setCurrentContext:nil]; + } +} + +@end + +#endif /* SDL_VIDEO_DRIVER_UIKIT */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index f302e6494f811..f62815dfe3dd5 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -36,6 +36,7 @@ #include "SDL_uikitmodes.h" #include "SDL_uikitwindow.h" #include "SDL_uikitopengles.h" +#include "SDL_uikitmetalangle.h" #include "SDL_uikitclipboard.h" #include "SDL_uikitvulkan.h" #include "SDL_uikitmetalview.h" @@ -111,7 +112,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) device->HasClipboardText = UIKit_HasClipboardText; /* OpenGL (ES) functions */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE device->GL_MakeCurrent = UIKit_GL_MakeCurrent; device->GL_GetDrawableSize = UIKit_GL_GetDrawableSize; device->GL_SwapWindow = UIKit_GL_SwapWindow; diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index 7b677e98336b9..dd11b416df9ad 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -33,6 +33,7 @@ #include "SDL_uikitmodes.h" #include "SDL_uikitwindow.h" #include "SDL_uikitopengles.h" +#include "SDL_uikitmetalangle.h" #if SDL_IPHONE_KEYBOARD #include "keyinfotable.h" @@ -179,7 +180,7 @@ - (void)doLoop:(CADisplayLink*)sender /* Don't run the game loop while a messagebox is up */ if (!UIKit_ShowingMessageBox()) { /* See the comment in the function definition. */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE UIKit_GL_RestoreCurrentContext(); #endif diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index 39e51813b78ac..d02b6b2dd6717 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -37,7 +37,12 @@ #import "SDL_uikitappdelegate.h" #import "SDL_uikitview.h" -#import "SDL_uikitopenglview.h" + +#if SDL_VIDEO_METALANGLE +#import "SDL_uikitmetalangleview.h" +#else +#import"SDL_uikitopenglview.h" +#endif #include @@ -370,6 +375,13 @@ - (void)layoutSubviews info->info.uikit.colorbuffer = glview.drawableRenderbuffer; info->info.uikit.resolveFramebuffer = glview.msaaResolveFramebuffer; } else { +#elif SDL_VIDEO_METALANGLE + if ([data.viewcontroller.view isKindOfClass:[SDL_uikitmetalangleview class]]) { + SDL_uikitmetalangleview *glview = (SDL_uikitmetalangleview *)data.viewcontroller.view; + info->info.uikit.framebuffer = glview.drawableFramebuffer; + info->info.uikit.colorbuffer = glview.drawableRenderbuffer; + info->info.uikit.resolveFramebuffer = glview.msaaResolveFramebuffer; + } else { #else { #endif From 79546b3958ce86e661110e440968368058073b61 Mon Sep 17 00:00:00 2001 From: Mirko Galimberti Date: Fri, 30 Apr 2021 23:14:17 +0200 Subject: [PATCH 2/2] Merge MetalANGLE implementation into opengles --- Xcode/SDL/SDL.xcodeproj/project.pbxproj | 80 ------- include/SDL_config.h.in | 3 - include/SDL_config_iphoneos.h | 1 + src/video/SDL_sysvideo.h | 2 +- src/video/SDL_video.c | 25 +-- src/video/uikit/SDL_uikitevents.m | 3 +- src/video/uikit/SDL_uikitmetalangle.h | 44 ---- src/video/uikit/SDL_uikitmetalangle.m | 249 ---------------------- src/video/uikit/SDL_uikitmetalangleview.h | 61 ------ src/video/uikit/SDL_uikitmetalangleview.m | 179 ---------------- src/video/uikit/SDL_uikitopengles.m | 32 ++- src/video/uikit/SDL_uikitopenglview.h | 12 ++ src/video/uikit/SDL_uikitopenglview.m | 105 ++++++++- src/video/uikit/SDL_uikitvideo.m | 3 +- src/video/uikit/SDL_uikitviewcontroller.m | 3 +- src/video/uikit/SDL_uikitwindow.m | 14 +- 16 files changed, 163 insertions(+), 653 deletions(-) delete mode 100644 src/video/uikit/SDL_uikitmetalangle.h delete mode 100644 src/video/uikit/SDL_uikitmetalangle.m delete mode 100644 src/video/uikit/SDL_uikitmetalangleview.h delete mode 100644 src/video/uikit/SDL_uikitmetalangleview.m diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 68aafdfcd415c..d4c1a9d90c5a1 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -3668,42 +3668,6 @@ AAC07105195606770073DCDF /* SDL_opengles2_khrplatform.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC070F8195606770073DCDF /* SDL_opengles2_khrplatform.h */; settings = {ATTRIBUTES = (Public, ); }; }; AAC07107195606770073DCDF /* SDL_opengles2_khrplatform.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC070F8195606770073DCDF /* SDL_opengles2_khrplatform.h */; settings = {ATTRIBUTES = (Public, ); }; }; AADA5B8716CCAB3000107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AC6A5E89262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; - AC6A5E8A262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; - AC6A5E8B262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; - AC6A5E8C262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; - AC6A5E8D262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; - AC6A5E8E262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; - AC6A5E8F262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; - AC6A5E90262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; - AC6A5E91262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */; }; - AC6A5E92262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; - AC6A5E93262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; - AC6A5E94262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; - AC6A5E95262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; - AC6A5E96262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; - AC6A5E97262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; - AC6A5E98262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; - AC6A5E99262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; - AC6A5E9A262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */; }; - AC6A5E9B262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; - AC6A5E9C262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; - AC6A5E9D262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; - AC6A5E9E262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; - AC6A5E9F262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; - AC6A5EA0262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; - AC6A5EA1262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; - AC6A5EA2262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; - AC6A5EA3262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */ = {isa = PBXBuildFile; fileRef = AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */; }; - AC6A5EA4262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; - AC6A5EA5262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; - AC6A5EA6262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; - AC6A5EA7262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; - AC6A5EA8262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; - AC6A5EA9262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; - AC6A5EAA262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; - AC6A5EAB262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; - AC6A5EAC262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */; }; DB0F489317C400E6008798C5 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */; settings = {ATTRIBUTES = (Public, ); }; }; DB0F490C17CA57ED008798C5 /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 567E2F2017C44C35005F1892 /* SDL_filesystem.h */; settings = {ATTRIBUTES = (Public, ); }; }; DB313FC817554B71006C0E22 /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C71595D4D800BBD41B /* begin_code.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -4393,10 +4357,6 @@ AAC070F7195606770073DCDF /* SDL_opengles2_gl2platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles2_gl2platform.h; sourceTree = ""; }; AAC070F8195606770073DCDF /* SDL_opengles2_khrplatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles2_khrplatform.h; sourceTree = ""; }; AADA5B8616CCAB3000107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = ""; }; - AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmetalangleview.m; sourceTree = ""; }; - AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmetalangleview.h; sourceTree = ""; }; - AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmetalangle.h; sourceTree = ""; }; - AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmetalangle.m; sourceTree = ""; }; BECDF66B0761BA81005FE872 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = ""; }; BECDF66C0761BA81005FE872 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BECDF6B30761BA81005FE872 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -5082,10 +5042,6 @@ A7D8A62D23E2513D00DCD162 /* SDL_uikitevents.h */, A7D8A61C23E2513D00DCD162 /* SDL_uikitevents.m */, A7D8A62623E2513D00DCD162 /* SDL_uikitmessagebox.h */, - AC6A5E87262C3582003D03DF /* SDL_uikitmetalangle.h */, - AC6A5E88262C3582003D03DF /* SDL_uikitmetalangle.m */, - AC6A5E86262C3582003D03DF /* SDL_uikitmetalangleview.h */, - AC6A5E85262C3582003D03DF /* SDL_uikitmetalangleview.m */, A7D8A61B23E2513D00DCD162 /* SDL_uikitmessagebox.m */, A7D8A61D23E2513D00DCD162 /* SDL_uikitmetalview.h */, A7D8A62E23E2513D00DCD162 /* SDL_uikitmetalview.m */, @@ -5802,7 +5758,6 @@ A75FCD4823E25AB700529352 /* SDL_keycode.h in Headers */, A75FCD4923E25AB700529352 /* SDL_x11keyboard.h in Headers */, 5616CA63252BB35F005D5928 /* SDL_sysurl.h in Headers */, - AC6A5E99262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A75FCD4A23E25AB700529352 /* SDL_cocoakeyboard.h in Headers */, A75FCD4B23E25AB700529352 /* SDL_uikitvulkan.h in Headers */, A75FCD4C23E25AB700529352 /* SDL_x11framebuffer.h in Headers */, @@ -5812,7 +5767,6 @@ A75FCD5023E25AB700529352 /* gl2ext.h in Headers */, A75FCD5123E25AB700529352 /* SDL_clipboardevents_c.h in Headers */, A75FCD5223E25AB700529352 /* SDL_x11touch.h in Headers */, - AC6A5EA2262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A75FCD5323E25AB700529352 /* SDL_syshaptic_c.h in Headers */, A75FCD5423E25AB700529352 /* SDL_hints_c.h in Headers */, A75FCD5523E25AB700529352 /* SDL_audiodev_c.h in Headers */, @@ -6047,7 +6001,6 @@ A75FCF0123E25AC700529352 /* SDL_keycode.h in Headers */, A75FCF0223E25AC700529352 /* SDL_x11keyboard.h in Headers */, 5616CA66252BB361005D5928 /* SDL_sysurl.h in Headers */, - AC6A5E9A262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A75FCF0323E25AC700529352 /* SDL_cocoakeyboard.h in Headers */, A75FCF0423E25AC700529352 /* SDL_uikitvulkan.h in Headers */, A75FCF0523E25AC700529352 /* SDL_x11framebuffer.h in Headers */, @@ -6057,7 +6010,6 @@ A75FCF0923E25AC700529352 /* gl2ext.h in Headers */, A75FCF0A23E25AC700529352 /* SDL_clipboardevents_c.h in Headers */, A75FCF0B23E25AC700529352 /* SDL_x11touch.h in Headers */, - AC6A5EA3262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A75FCF0C23E25AC700529352 /* SDL_syshaptic_c.h in Headers */, A75FCF0D23E25AC700529352 /* SDL_hints_c.h in Headers */, A75FCF0E23E25AC700529352 /* SDL_audiodev_c.h in Headers */, @@ -6299,7 +6251,6 @@ A769B0D323E259AE00872273 /* SDL_x11video.h in Headers */, A769B0D423E259AE00872273 /* vulkan.hpp in Headers */, A769B0D623E259AE00872273 /* gl2ext.h in Headers */, - AC6A5EA0262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A769B0D723E259AE00872273 /* SDL_clipboardevents_c.h in Headers */, A769B0D823E259AE00872273 /* SDL_x11touch.h in Headers */, A769B0D923E259AE00872273 /* SDL_syshaptic_c.h in Headers */, @@ -6386,7 +6337,6 @@ A769B13F23E259AE00872273 /* SDL_offscreenframebuffer_c.h in Headers */, A769B14023E259AE00872273 /* SDL_displayevents_c.h in Headers */, A769B14123E259AE00872273 /* SDL_timer_c.h in Headers */, - AC6A5E97262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A769B14223E259AE00872273 /* gl2.h in Headers */, A769B14323E259AE00872273 /* SDL_sysmutex_c.h in Headers */, A769B14423E259AE00872273 /* scancodes_windows.h in Headers */, @@ -6471,7 +6421,6 @@ A7D8B9F023E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8BB2E23E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8B79523E2514400DCD162 /* SDL_dummyaudio.h in Headers */, - AC6A5E93262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8A96423E2514000DCD162 /* SDL_dummysensor.h in Headers */, A7D8AB0B23E2514100DCD162 /* SDL_dynapi.h in Headers */, A7D8AB1123E2514100DCD162 /* SDL_dynapi_overrides.h in Headers */, @@ -6572,7 +6521,6 @@ A7D88A5323E2437C00DCD162 /* SDL_system.h in Headers */, A7D8B3E723E2514300DCD162 /* SDL_systhread.h in Headers */, A7D8B42923E2514300DCD162 /* SDL_systhread_c.h in Headers */, - AC6A5E9C262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, 5616CA51252BB35A005D5928 /* SDL_sysurl.h in Headers */, A7D8AC4023E2514100DCD162 /* SDL_sysvideo.h in Headers */, A7D88A5423E2437C00DCD162 /* SDL_syswm.h in Headers */, @@ -6721,7 +6669,6 @@ A7D8B9F123E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8BB2F23E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8B79623E2514400DCD162 /* SDL_dummyaudio.h in Headers */, - AC6A5E94262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8A96523E2514000DCD162 /* SDL_dummysensor.h in Headers */, A7D8AB0C23E2514100DCD162 /* SDL_dynapi.h in Headers */, A7D8AB1223E2514100DCD162 /* SDL_dynapi_overrides.h in Headers */, @@ -6822,7 +6769,6 @@ A7D88C0E23E24BED00DCD162 /* SDL_system.h in Headers */, A7D8B3E823E2514300DCD162 /* SDL_systhread.h in Headers */, A7D8B42A23E2514300DCD162 /* SDL_systhread_c.h in Headers */, - AC6A5E9D262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, 5616CA54252BB35B005D5928 /* SDL_sysurl.h in Headers */, A7D8AC4123E2514100DCD162 /* SDL_sysvideo.h in Headers */, A7D88C0F23E24BED00DCD162 /* SDL_syswm.h in Headers */, @@ -6985,7 +6931,6 @@ A7D8B22223E2514200DCD162 /* SDL_x11video.h in Headers */, A7D8B27023E2514200DCD162 /* vulkan.hpp in Headers */, A7D8B22823E2514200DCD162 /* gl2ext.h in Headers */, - AC6A5E9F262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A7D8BB7323E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */, A7D8B14A23E2514200DCD162 /* SDL_x11touch.h in Headers */, A7D8AAE423E2514100DCD162 /* SDL_syshaptic_c.h in Headers */, @@ -7072,7 +7017,6 @@ A7D8AB8323E2514100DCD162 /* SDL_offscreenframebuffer_c.h in Headers */, A7D8BB4323E2514500DCD162 /* SDL_displayevents_c.h in Headers */, A7D8AB3523E2514100DCD162 /* SDL_timer_c.h in Headers */, - AC6A5E96262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8B22E23E2514200DCD162 /* gl2.h in Headers */, A7D8B44423E2514300DCD162 /* SDL_sysmutex_c.h in Headers */, A7D8BB2523E2514500DCD162 /* scancodes_windows.h in Headers */, @@ -7157,7 +7101,6 @@ A7D8B9EF23E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8BB2D23E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8B79423E2514400DCD162 /* SDL_dummyaudio.h in Headers */, - AC6A5E92262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8A96323E2514000DCD162 /* SDL_dummysensor.h in Headers */, A7D8AB0A23E2514100DCD162 /* SDL_dynapi.h in Headers */, A7D8AB1023E2514100DCD162 /* SDL_dynapi_overrides.h in Headers */, @@ -7258,7 +7201,6 @@ AA75584E1595D4D800BBD41B /* SDL_system.h in Headers */, A7D8B3E623E2514300DCD162 /* SDL_systhread.h in Headers */, A7D8B42823E2514300DCD162 /* SDL_systhread_c.h in Headers */, - AC6A5E9B262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, 5616CA4D252BB2A6005D5928 /* SDL_sysurl.h in Headers */, A7D8AC3F23E2514100DCD162 /* SDL_sysvideo.h in Headers */, AA7558501595D4D800BBD41B /* SDL_syswm.h in Headers */, @@ -7370,7 +7312,6 @@ A7D8AB8823E2514100DCD162 /* SDL_offscreenwindow.h in Headers */, A7D8A97223E2514000DCD162 /* SDL_coremotionsensor.h in Headers */, A7D8BB3023E2514500DCD162 /* SDL_dropevents_c.h in Headers */, - AC6A5E9E262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A7D8AABF23E2514100DCD162 /* SDL_haptic_c.h in Headers */, A7D8A94823E2514000DCD162 /* SDL_dataqueue.h in Headers */, A7D8A96023E2514000DCD162 /* SDL_error_c.h in Headers */, @@ -7466,7 +7407,6 @@ A7D8B1F723E2514200DCD162 /* SDL_x11dyn.h in Headers */, A7D8BB6623E2514500DCD162 /* SDL_touch_c.h in Headers */, A7D8B4AF23E2514300DCD162 /* SDL_gamecontrollerdb.h in Headers */, - AC6A5E95262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8AEEB23E2514100DCD162 /* SDL_cocoavulkan.h in Headers */, A7D8B23323E2514200DCD162 /* gl2platform.h in Headers */, A7D8B25123E2514200DCD162 /* vk_layer.h in Headers */, @@ -7623,7 +7563,6 @@ DB313FDB17554B71006C0E22 /* SDL_keycode.h in Headers */, A7D8B20B23E2514200DCD162 /* SDL_x11keyboard.h in Headers */, A7D8AE9323E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */, - AC6A5E98262C3582003D03DF /* SDL_uikitmetalangleview.h in Headers */, A7D8ACE623E2514100DCD162 /* SDL_uikitvulkan.h in Headers */, A7D8B1F323E2514200DCD162 /* SDL_x11framebuffer.h in Headers */, A7D8B22323E2514200DCD162 /* SDL_x11video.h in Headers */, @@ -7633,7 +7572,6 @@ A7D8BB7423E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */, A7D8B14B23E2514200DCD162 /* SDL_x11touch.h in Headers */, A7D8AAE523E2514100DCD162 /* SDL_syshaptic_c.h in Headers */, - AC6A5EA1262C3582003D03DF /* SDL_uikitmetalangle.h in Headers */, A7D8B94F23E2514400DCD162 /* SDL_hints_c.h in Headers */, A7D8B7B723E2514400DCD162 /* SDL_audiodev_c.h in Headers */, A7D8B7A523E2514400DCD162 /* SDL_audio_c.h in Headers */, @@ -8264,7 +8202,6 @@ A75FCE1323E25AB700529352 /* SDL_coreaudio.m in Sources */, A75FCE1423E25AB700529352 /* SDL_blendline.c in Sources */, A75FCE1523E25AB700529352 /* SDL_blit_A.c in Sources */, - AC6A5E90262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A75FCE1623E25AB700529352 /* SDL_d3dmath.c in Sources */, A75FCE1723E25AB700529352 /* SDL_x11mouse.c in Sources */, A75FCE1823E25AB700529352 /* SDL_nullvideo.c in Sources */, @@ -8336,7 +8273,6 @@ A75FCE5523E25AB700529352 /* SDL_blit_0.c in Sources */, A75FCE5623E25AB700529352 /* k_tan.c in Sources */, A75FCE5723E25AB700529352 /* SDL_x11vulkan.c in Sources */, - AC6A5EAB262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A75FCE5823E25AB700529352 /* SDL_diskaudio.c in Sources */, A75FCE5923E25AB700529352 /* SDL_egl.c in Sources */, A75FCE5A23E25AB700529352 /* SDL_RLEaccel.c in Sources */, @@ -8468,7 +8404,6 @@ A75FCFCC23E25AC700529352 /* SDL_coreaudio.m in Sources */, A75FCFCD23E25AC700529352 /* SDL_blendline.c in Sources */, A75FCFCE23E25AC700529352 /* SDL_blit_A.c in Sources */, - AC6A5E91262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A75FCFCF23E25AC700529352 /* SDL_d3dmath.c in Sources */, A75FCFD023E25AC700529352 /* SDL_x11mouse.c in Sources */, A75FCFD123E25AC700529352 /* SDL_nullvideo.c in Sources */, @@ -8540,7 +8475,6 @@ A75FD00E23E25AC700529352 /* SDL_blit_0.c in Sources */, A75FD00F23E25AC700529352 /* k_tan.c in Sources */, A75FD01023E25AC700529352 /* SDL_x11vulkan.c in Sources */, - AC6A5EAC262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A75FD01123E25AC700529352 /* SDL_diskaudio.c in Sources */, A75FD01223E25AC700529352 /* SDL_egl.c in Sources */, A75FD01323E25AC700529352 /* SDL_RLEaccel.c in Sources */, @@ -8695,7 +8629,6 @@ A769B19E23E259AE00872273 /* SDL_blit_A.c in Sources */, A769B19F23E259AE00872273 /* SDL_d3dmath.c in Sources */, A769B1A023E259AE00872273 /* SDL_x11mouse.c in Sources */, - AC6A5E8E262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A769B1A123E259AE00872273 /* SDL_nullvideo.c in Sources */, A769B1A223E259AE00872273 /* SDL_offscreenevents.c in Sources */, A769B1A323E259AE00872273 /* SDL_uikitview.m in Sources */, @@ -8823,7 +8756,6 @@ A769B21723E259AE00872273 /* SDL_offscreenopengl.c in Sources */, A769B21823E259AE00872273 /* SDL_uikitmetalview.m in Sources */, A769B21923E259AE00872273 /* SDL_shaders_gles2.c in Sources */, - AC6A5EA9262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A769B21A23E259AE00872273 /* SDL_blit_1.c in Sources */, A769B21B23E259AE00872273 /* SDL_x11dyn.c in Sources */, A769B21C23E259AE00872273 /* SDL_mouse.c in Sources */, @@ -8901,7 +8833,6 @@ A7D8ADF323E2514100DCD162 /* SDL_blit_A.c in Sources */, A7D8BA3823E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17723E2514200DCD162 /* SDL_x11mouse.c in Sources */, - AC6A5E8A262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8ABEC23E2514100DCD162 /* SDL_nullvideo.c in Sources */, A7D8AB6823E2514100DCD162 /* SDL_offscreenevents.c in Sources */, A7D8ACA623E2514100DCD162 /* SDL_uikitview.m in Sources */, @@ -8973,7 +8904,6 @@ A7D8B15F23E2514200DCD162 /* SDL_x11vulkan.c in Sources */, A7D8B8A923E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC123E2514200DCD162 /* SDL_egl.c in Sources */, - AC6A5EA5262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8AC3423E2514100DCD162 /* SDL_RLEaccel.c in Sources */, A7D8BBB223E2514500DCD162 /* SDL_assert.c in Sources */, A7D8B3DB23E2514300DCD162 /* SDL_bmp.c in Sources */, @@ -9105,7 +9035,6 @@ A7D8ADF423E2514100DCD162 /* SDL_blit_A.c in Sources */, A7D8BA3923E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17823E2514200DCD162 /* SDL_x11mouse.c in Sources */, - AC6A5E8B262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8ABED23E2514100DCD162 /* SDL_nullvideo.c in Sources */, A7D8AB6923E2514100DCD162 /* SDL_offscreenevents.c in Sources */, A7D8ACA723E2514100DCD162 /* SDL_uikitview.m in Sources */, @@ -9177,7 +9106,6 @@ A75FDBD023EA380300529352 /* SDL_hidapi_rumble.c in Sources */, A7D8B8AA23E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC223E2514200DCD162 /* SDL_egl.c in Sources */, - AC6A5EA6262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8AC3523E2514100DCD162 /* SDL_RLEaccel.c in Sources */, A7D8BBB323E2514500DCD162 /* SDL_assert.c in Sources */, A7D8B3DC23E2514300DCD162 /* SDL_bmp.c in Sources */, @@ -9308,7 +9236,6 @@ A7D8ADF623E2514100DCD162 /* SDL_blit_A.c in Sources */, A7D8BA3B23E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17A23E2514200DCD162 /* SDL_x11mouse.c in Sources */, - AC6A5E8D262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8ABEF23E2514100DCD162 /* SDL_nullvideo.c in Sources */, A7D8AB6B23E2514100DCD162 /* SDL_offscreenevents.c in Sources */, A7D8ACA923E2514100DCD162 /* SDL_uikitview.m in Sources */, @@ -9436,7 +9363,6 @@ A7D8AB5923E2514100DCD162 /* SDL_offscreenopengl.c in Sources */, A7D8ACC723E2514100DCD162 /* SDL_uikitmetalview.m in Sources */, A7D8BA5F23E2514400DCD162 /* SDL_shaders_gles2.c in Sources */, - AC6A5EA8262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8B14423E2514200DCD162 /* SDL_blit_1.c in Sources */, A7D8B18023E2514200DCD162 /* SDL_x11dyn.c in Sources */, A7D8BB1923E2514500DCD162 /* SDL_mouse.c in Sources */, @@ -9514,7 +9440,6 @@ A7D8BA1F23E2514400DCD162 /* SDL_blendline.c in Sources */, A7D8BBE723E2574800DCD162 /* SDL_uikitviewcontroller.m in Sources */, A7D8ADF223E2514100DCD162 /* SDL_blit_A.c in Sources */, - AC6A5E89262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8BBDD23E2574800DCD162 /* SDL_uikitmodes.m in Sources */, A7D8BA3723E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17623E2514200DCD162 /* SDL_x11mouse.c in Sources */, @@ -9586,7 +9511,6 @@ A7D8ADE623E2514100DCD162 /* SDL_blit_0.c in Sources */, A7D8BB0923E2514500DCD162 /* k_tan.c in Sources */, A7D8B15E23E2514200DCD162 /* SDL_x11vulkan.c in Sources */, - AC6A5EA4262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8B8A823E2514400DCD162 /* SDL_diskaudio.c in Sources */, 566E26CF246274CC00718109 /* SDL_syslocale.m in Sources */, A7D8AFC023E2514200DCD162 /* SDL_egl.c in Sources */, @@ -9718,7 +9642,6 @@ A7D8B53C23E2514300DCD162 /* SDL_hidapi_xbox360.c in Sources */, A7D8B8D523E2514400DCD162 /* SDL_coreaudio.m in Sources */, A7D8BA2223E2514400DCD162 /* SDL_blendline.c in Sources */, - AC6A5E8C262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8BC0623E2574800DCD162 /* SDL_uikitwindow.m in Sources */, A7D8ADF523E2514100DCD162 /* SDL_blit_A.c in Sources */, A7D8BA3A23E2514400DCD162 /* SDL_d3dmath.c in Sources */, @@ -9790,7 +9713,6 @@ A7D8BBF223E2574800DCD162 /* SDL_uikitevents.m in Sources */, A7D8B16123E2514200DCD162 /* SDL_x11vulkan.c in Sources */, A7D8BBB923E2560500DCD162 /* SDL_steamcontroller.c in Sources */, - AC6A5EA7262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8B8AB23E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC323E2514200DCD162 /* SDL_egl.c in Sources */, A7D8AC3623E2514100DCD162 /* SDL_RLEaccel.c in Sources */, @@ -9922,7 +9844,6 @@ A7D8B8D723E2514400DCD162 /* SDL_coreaudio.m in Sources */, A7D8BA2423E2514400DCD162 /* SDL_blendline.c in Sources */, A7D8ADF723E2514100DCD162 /* SDL_blit_A.c in Sources */, - AC6A5E8F262C3582003D03DF /* SDL_uikitmetalangleview.m in Sources */, A7D8BA3C23E2514400DCD162 /* SDL_d3dmath.c in Sources */, A7D8B17B23E2514200DCD162 /* SDL_x11mouse.c in Sources */, A7D8ABF023E2514100DCD162 /* SDL_nullvideo.c in Sources */, @@ -9994,7 +9915,6 @@ A7D8ADEB23E2514100DCD162 /* SDL_blit_0.c in Sources */, A7D8BB0E23E2514500DCD162 /* k_tan.c in Sources */, A7D8B16323E2514200DCD162 /* SDL_x11vulkan.c in Sources */, - AC6A5EAA262C3582003D03DF /* SDL_uikitmetalangle.m in Sources */, A7D8B8AD23E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC523E2514200DCD162 /* SDL_egl.c in Sources */, A7D8AC3823E2514100DCD162 /* SDL_RLEaccel.c in Sources */, diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 90ad8175a04bc..9ddd932e3779f 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -424,9 +424,6 @@ /* Enable Metal support */ #undef SDL_VIDEO_METAL -/* Enable MetalANGLE support */ -#undef SDL_VIDEO_METALANGLE - /* Enable system power support */ #undef SDL_POWER_LINUX #undef SDL_POWER_WINDOWS diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h index 9a748beb6616e..fee1c75a99b4e 100644 --- a/include/SDL_config_iphoneos.h +++ b/include/SDL_config_iphoneos.h @@ -175,6 +175,7 @@ #define SDL_VIDEO_OPENGL_ES 1 #define SDL_VIDEO_RENDER_OGL_ES 1 #define SDL_VIDEO_RENDER_OGL_ES2 1 +#define SDL_VIDEO_OPENGL_METALANGLE 0 #endif /* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index e933729f5d677..682e52592921b 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -402,7 +402,7 @@ struct SDL_VideoDevice struct SDL_EGL_VideoData *egl_data; #endif -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 struct SDL_PrivateGLESData *gles_data; #endif diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 9cae85b73edc6..86603c5e849ee 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -43,16 +43,17 @@ /* GL and GLES2 headers conflict on Linux 32 bits */ #if SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL -#include "SDL_opengles2.h" -#endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */ - -#if SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL_METALANGLE #include #include #ifndef APIENTRY #define APIENTRY GL_APIENTRY #endif -#endif /* SDL_VIDEO_METALANGLE */ +#else +#include "SDL_opengles2.h" +#endif /* SDL_VIDEO_OPENGL_METALANGLE */ +#endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */ + #if !SDL_VIDEO_OPENGL #ifndef GL_CONTEXT_RELEASE_BEHAVIOR_KHR @@ -255,7 +256,7 @@ ShouldUseTextureFramebuffer() } return hasAcceleratedOpenGL; } -#elif SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#elif SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 /* Let's be optimistic about this! */ return SDL_TRUE; #else @@ -3166,7 +3167,7 @@ SDL_GL_UnloadLibrary(void) } } -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 static SDL_INLINE SDL_bool isAtLeastGL3(const char *verstr) { @@ -3177,7 +3178,7 @@ isAtLeastGL3(const char *verstr) SDL_bool SDL_GL_ExtensionSupported(const char *extension) { -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 const GLubyte *(APIENTRY * glGetStringFunc) (GLenum); const char *extensions; const char *start; @@ -3269,7 +3270,7 @@ SDL_GL_DeduceMaxSupportedESProfile(int* major, int* minor) { /* THIS REQUIRES AN EXISTING GL CONTEXT THAT HAS BEEN MADE CURRENT. */ /* Please refer to https://bugzilla.libsdl.org/show_bug.cgi?id=3725 for discussion. */ -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 /* XXX This is fragile; it will break in the event of release of * new versions of OpenGL ES. */ @@ -3318,7 +3319,7 @@ SDL_GL_ResetAttributes() _this->gl_config.major_version = 2; _this->gl_config.minor_version = 1; _this->gl_config.profile_mask = 0; -#elif SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#elif SDL_VIDEO_OPENGL_ES2 _this->gl_config.major_version = 2; _this->gl_config.minor_version = 0; _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; @@ -3346,7 +3347,7 @@ SDL_GL_ResetAttributes() int SDL_GL_SetAttribute(SDL_GLattr attr, int value) { -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 int retval; if (!_this) { @@ -3467,7 +3468,7 @@ SDL_GL_SetAttribute(SDL_GLattr attr, int value) int SDL_GL_GetAttribute(SDL_GLattr attr, int *value) { -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 GLenum (APIENTRY *glGetErrorFunc) (void); GLenum attrib = 0; GLenum error = 0; diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index 40ddf42ce1baf..4219164c34dbf 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -27,7 +27,6 @@ #include "SDL_uikitvideo.h" #include "SDL_uikitevents.h" #include "SDL_uikitopengles.h" -#include "SDL_uikitmetalangle.h" #import @@ -73,7 +72,7 @@ touch events to get processed (which is important to get certain } while(result == kCFRunLoopRunHandledSource); /* See the comment in the function definition. */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 UIKit_GL_RestoreCurrentContext(); #endif } diff --git a/src/video/uikit/SDL_uikitmetalangle.h b/src/video/uikit/SDL_uikitmetalangle.h deleted file mode 100644 index 71c2bbd128c9b..0000000000000 --- a/src/video/uikit/SDL_uikitmetalangle.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#ifndef SDL_uikitmetalangle_ -#define SDL_uikitmetalangle_ - -#if SDL_VIDEO_METALANGLE - -#include "../SDL_sysvideo.h" - -extern int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, - SDL_GLContext context); -extern void UIKit_GL_GetDrawableSize(_THIS, SDL_Window * window, - int * w, int * h); -extern int UIKit_GL_SwapWindow(_THIS, SDL_Window * window); -extern SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window); -extern void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context); -extern void *UIKit_GL_GetProcAddress(_THIS, const char *proc); -extern int UIKit_GL_LoadLibrary(_THIS, const char *path); - -extern void UIKit_GL_RestoreCurrentContext(void); - -#endif SDL_VIDEO_METALANGLE - -#endif /* SDL_uikitmetalangle_ */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/uikit/SDL_uikitmetalangle.m b/src/video/uikit/SDL_uikitmetalangle.m deleted file mode 100644 index 97bb4171d5aa1..0000000000000 --- a/src/video/uikit/SDL_uikitmetalangle.m +++ /dev/null @@ -1,249 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_VIDEO_DRIVER_UIKIT && SDL_VIDEO_METALANGLE - -#include "SDL_uikitmetalangle.h" -#import "SDL_uikitmetalangleview.h" -#include "SDL_uikitmodes.h" -#include "SDL_uikitwindow.h" -#include "SDL_uikitevents.h" -#include "../SDL_sysvideo.h" -#include "../../events/SDL_keyboard_c.h" -#include "../../events/SDL_mouse_c.h" -#include "../../power/uikit/SDL_syspower.h" -#include "SDL_loadso.h" -#include - -@interface SDLEAGLContext : MGLContext - -/* The OpenGL ES context owns a view / drawable. */ -@property (nonatomic, strong) SDL_uikitmetalangleview *sdlView; - -@end - -@implementation SDLEAGLContext - -- (void)dealloc -{ - /* When the context is deallocated, its view should be removed from any - * SDL window that it's attached to. */ - [self.sdlView setSDLWindow:NULL]; -} - -@end - -void * -UIKit_GL_GetProcAddress(_THIS, const char *proc) -{ - /* Look through all SO's for the proc symbol. Here's why: - * -Looking for the path to the OpenGL Library seems not to work in the iOS Simulator. - * -We don't know that the path won't change in the future. */ - return dlsym(RTLD_DEFAULT, proc); -} - -/* - note that SDL_GL_DeleteContext makes it current without passing the window -*/ -int -UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) -{ - @autoreleasepool { - SDLEAGLContext *eaglcontext = (__bridge SDLEAGLContext *) context; - - if (![MGLContext setCurrentContext:eaglcontext forLayer:(MGLLayer*)eaglcontext.sdlView.layer]) { - return SDL_SetError("Could not make EAGL context current"); - } - - if (eaglcontext) { - [eaglcontext.sdlView setSDLWindow:window]; - } - } - - return 0; -} - -void -UIKit_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) -{ - @autoreleasepool { - SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; - UIView *view = data.viewcontroller.view; - if ([view isKindOfClass:[SDL_uikitmetalangleview class]]) { - SDL_uikitmetalangleview *glview = (SDL_uikitmetalangleview *) view; - if (w) { - *w = glview.backingWidth; - } - if (h) { - *h = glview.backingHeight; - } - } else { - SDL_GetWindowSize(window, w, h); - } - } -} - -int -UIKit_GL_LoadLibrary(_THIS, const char *path) -{ - /* We shouldn't pass a path to this function, since we've already loaded the - * library. */ - if (path != NULL) { - return SDL_SetError("iOS GL Load Library just here for compatibility"); - } - return 0; -} - -int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) -{ - @autoreleasepool { - SDLEAGLContext *context = (__bridge SDLEAGLContext *) SDL_GL_GetCurrentContext(); - -#if SDL_POWER_UIKIT - /* Check once a frame to see if we should turn off the battery monitor. */ - SDL_UIKit_UpdateBatteryMonitoring(); -#endif - - [context.sdlView swapBuffers]; - - /* You need to pump events in order for the OS to make changes visible. - * We don't pump events here because we don't want iOS application events - * (low memory, terminate, etc.) to happen inside low level rendering. */ - } - return 0; -} - -SDL_GLContext -UIKit_GL_CreateContext(_THIS, SDL_Window * window) -{ - @autoreleasepool { - SDLEAGLContext *context = nil; - SDL_uikitmetalangleview *view; - SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; - CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen); - MGLSharegroup *sharegroup = nil; - CGFloat scale = 1.0; - int samples = 0; - int major = _this->gl_config.major_version; - int minor = _this->gl_config.minor_version; - - /* The EAGLRenderingAPI enum values currently map 1:1 to major GLES - * versions. */ - MGLRenderingAPI api = major; - - /* iOS currently doesn't support GLES >3.0. iOS 6 also only supports up - * to GLES 2.0. */ - if (major > 3 || (major == 3 && (minor > 0 || !UIKit_IsSystemVersionAtLeast(7.0)))) { - SDL_SetError("OpenGL ES %d.%d context could not be created", major, minor); - return NULL; - } - - if (_this->gl_config.multisamplebuffers > 0) { - samples = _this->gl_config.multisamplesamples; - } - - if (_this->gl_config.share_with_current_context) { - MGLContext *context = (__bridge MGLContext *) SDL_GL_GetCurrentContext(); - sharegroup = context.sharegroup; - } - - if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { - /* Set the scale to the natural scale factor of the screen - the - * backing dimensions of the OpenGL view will match the pixel - * dimensions of the screen rather than the dimensions in points. */ - if ([data.uiwindow.screen respondsToSelector:@selector(nativeScale)]) { - scale = data.uiwindow.screen.nativeScale; - } else { - scale = data.uiwindow.screen.scale; - } - } - - context = [[SDLEAGLContext alloc] initWithAPI:api sharegroup:sharegroup]; - if (!context || ![MGLContext setCurrentContext:context]) { - SDL_SetError("OpenGL ES %d context could not be created", _this->gl_config.major_version); - return NULL; - } - - /* construct our view, passing in SDL's OpenGL configuration data */ - view = [[SDL_uikitmetalangleview alloc] initWithFrame:frame - scale:scale - retainBacking:_this->gl_config.retained_backing - rBits:_this->gl_config.red_size - gBits:_this->gl_config.green_size - bBits:_this->gl_config.blue_size - aBits:_this->gl_config.alpha_size - depthBits:_this->gl_config.depth_size - stencilBits:_this->gl_config.stencil_size - sRGB:_this->gl_config.framebuffer_srgb_capable - multisamples:samples - context:context]; - - if (!view) { - return NULL; - } - - /* The context owns the view / drawable. */ - context.sdlView = view; - - if (UIKit_GL_MakeCurrent(_this, window, (__bridge SDL_GLContext) context) < 0) { - UIKit_GL_DeleteContext(_this, (SDL_GLContext) CFBridgingRetain(context)); - return NULL; - } - - /* We return a +1'd context. The window's driverdata owns the view (via - * MakeCurrent.) */ - return (SDL_GLContext) CFBridgingRetain(context); - } -} - -void -UIKit_GL_DeleteContext(_THIS, SDL_GLContext context) -{ - @autoreleasepool { - /* The context was retained in SDL_GL_CreateContext, so we release it - * here. The context's view will be detached from its window when the - * context is deallocated. */ - CFRelease(context); - } -} - -void -UIKit_GL_RestoreCurrentContext(void) -{ - @autoreleasepool { - /* Some iOS system functionality (such as Dictation on the on-screen - keyboard) uses its own OpenGL ES context but doesn't restore the - previous one when it's done. This is a workaround to make sure the - expected SDL-created OpenGL ES context is active after the OS is - finished running its own code for the frame. If this isn't done, the - app may crash or have other nasty symptoms when Dictation is used. - */ - MGLContext *context = (__bridge MGLContext *) SDL_GL_GetCurrentContext(); - if (context != NULL && [MGLContext currentContext] != context) { - [MGLContext setCurrentContext:context]; - } - } -} - -#endif /* SDL_VIDEO_DRIVER_UIKIT */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/uikit/SDL_uikitmetalangleview.h b/src/video/uikit/SDL_uikitmetalangleview.h deleted file mode 100644 index 2c017fb38aac3..0000000000000 --- a/src/video/uikit/SDL_uikitmetalangleview.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#if SDL_VIDEO_METALANGLE - -#import -#import - -#import "SDL_uikitview.h" -#include "SDL_uikitvideo.h" - -@interface SDL_uikitmetalangleview : SDL_uikitview - -- (instancetype)initWithFrame:(CGRect)frame - scale:(CGFloat)scale - retainBacking:(BOOL)retained - rBits:(int)rBits - gBits:(int)gBits - bBits:(int)bBits - aBits:(int)aBits - depthBits:(int)depthBits - stencilBits:(int)stencilBits - sRGB:(BOOL)sRGB - multisamples:(int)multisamples - context:(MGLContext *)glcontext; - -@property (nonatomic, readonly, weak) MGLContext *context; - -/* The width and height of the drawable in pixels (as opposed to points.) */ -@property (nonatomic, readonly) int backingWidth; -@property (nonatomic, readonly) int backingHeight; - -@property (nonatomic, readonly) GLuint drawableRenderbuffer; -@property (nonatomic, readonly) GLuint drawableFramebuffer; -@property (nonatomic, readonly) GLuint msaaResolveFramebuffer; - -- (void)swapBuffers; - -@end - -#endif // SDL_VIDEO_METALANGLE - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/uikit/SDL_uikitmetalangleview.m b/src/video/uikit/SDL_uikitmetalangleview.m deleted file mode 100644 index 1712cb99e16b9..0000000000000 --- a/src/video/uikit/SDL_uikitmetalangleview.m +++ /dev/null @@ -1,179 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_VIDEO_DRIVER_UIKIT && SDL_VIDEO_METALANGLE - -#import -#import -#import -#import -#import "SDL_uikitmetalangleview.h" -#include "SDL_uikitwindow.h" - -@implementation SDL_uikitmetalangleview { - /* The renderbuffer and framebuffer used to render to this layer. */ - GLuint viewRenderbuffer, viewFramebuffer; - - /* format of depthRenderbuffer */ - GLenum depthBufferFormat; - - /* The number of MSAA samples. */ - int samples; - - BOOL retainedBacking; -} - -@synthesize context; -@synthesize backingWidth; -@synthesize backingHeight; - -+ (Class)layerClass -{ - return [MGLLayer class]; -} - -- (instancetype)initWithFrame:(CGRect)frame - scale:(CGFloat)scale - retainBacking:(BOOL)retained - rBits:(int)rBits - gBits:(int)gBits - bBits:(int)bBits - aBits:(int)aBits - depthBits:(int)depthBits - stencilBits:(int)stencilBits - sRGB:(BOOL)sRGB - multisamples:(int)multisamples - context:(MGLContext *)glcontext -{ - if ((self = [super initWithFrame:frame])) { - const BOOL useStencilBuffer = (stencilBits != 0); - const BOOL useDepthBuffer = (depthBits != 0); - int colorFormat; - - context = glcontext; - samples = multisamples; - retainedBacking = retained; - - MGLLayer *eaglLayer = (MGLLayer *)self.layer; - - if (samples > 0) { - GLint maxsamples = 0; - glGetIntegerv(GL_MAX_SAMPLES, &maxsamples); - - /* Clamp the samples to the max supported count. */ - samples = MIN(samples, maxsamples); - } - - if (sRGB) { - colorFormat = MGLDrawableColorFormatSRGBA8888; - } else if (rBits >= 8 || gBits >= 8 || bBits >= 8 || aBits > 0) { - /* if user specifically requests rbg888 or some color format higher than 16bpp */ - colorFormat = MGLDrawableColorFormatRGBA8888; - } else { - /* default case (potentially faster) */ - colorFormat = MGLDrawableColorFormatRGB565; - } - - eaglLayer.opaque = YES; - eaglLayer.drawableColorFormat = colorFormat; - eaglLayer.retainedBacking = retained; - - /* Set the appropriate scale (for retina display support) */ - self.contentScaleFactor = scale; - eaglLayer.contentsScale = scale; - - if (!context || ![MGLContext setCurrentContext:context]) { - SDL_SetError("Could not create OpenGL ES drawable (could not make context current)"); - return nil; - } - - viewFramebuffer = eaglLayer.defaultOpenGLFrameBufferID; - backingWidth = eaglLayer.drawableSize.width; - backingHeight = eaglLayer.drawableSize.height; - - if (samples > 0) { - eaglLayer.drawableMultisample = samples; - } - - if (useDepthBuffer || useStencilBuffer) { - if (useDepthBuffer) { - eaglLayer.drawableDepthFormat = MGLDrawableDepthFormat16; - } - if (useStencilBuffer) { - eaglLayer.drawableStencilFormat = MGLDrawableStencilFormat8; - } - } - } - - return self; -} - -- (GLuint)drawableRenderbuffer -{ - return viewFramebuffer; -} - -- (GLuint)drawableFramebuffer -{ - return viewFramebuffer; -} - -- (GLuint)msaaResolveFramebuffer -{ - return viewFramebuffer; -} - -- (void)swapBuffers -{ - MGLLayer *eaglLayer = (MGLLayer *)self.layer; - [MGLContext setCurrentContext:context forLayer:eaglLayer]; - [context present:eaglLayer]; -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - - int width = (int) (self.bounds.size.width * self.contentScaleFactor); - int height = (int) (self.bounds.size.height * self.contentScaleFactor); - - /* Update the backingWidth and backingHeight if the layer size has changed. */ - if (width != backingWidth || height != backingHeight) { - MGLLayer *eaglLayer = (MGLLayer *)self.layer; - [MGLContext setCurrentContext:context forLayer:eaglLayer]; - backingWidth = eaglLayer.drawableSize.width; - backingHeight = eaglLayer.drawableSize.height; - } -} - -- (void)dealloc -{ - if (context && context == [MGLContext currentContext]) { - [MGLContext setCurrentContext:nil]; - } -} - -@end - -#endif /* SDL_VIDEO_DRIVER_UIKIT */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/uikit/SDL_uikitopengles.m b/src/video/uikit/SDL_uikitopengles.m index 92e3e0ddf95b2..ee2ecad3bf5bf 100644 --- a/src/video/uikit/SDL_uikitopengles.m +++ b/src/video/uikit/SDL_uikitopengles.m @@ -34,7 +34,11 @@ #include "SDL_loadso.h" #include +#if SDL_VIDEO_OPENGL_METALANGLE +@interface SDLEAGLContext : MGLContext +#else @interface SDLEAGLContext : EAGLContext +#endif /* The OpenGL ES context owns a view / drawable. */ @property (nonatomic, strong) SDL_uikitopenglview *sdlView; @@ -69,8 +73,13 @@ - (void)dealloc { @autoreleasepool { SDLEAGLContext *eaglcontext = (__bridge SDLEAGLContext *) context; - - if (![EAGLContext setCurrentContext:eaglcontext]) { + +#if SDL_VIDEO_OPENGL_METALANGLE + if (![MGLContext setCurrentContext:eaglcontext]) +#else + if (![EAGLContext setCurrentContext:eaglcontext]) +#endif + { return SDL_SetError("Could not make EAGL context current"); } @@ -140,7 +149,11 @@ int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) SDL_uikitopenglview *view; SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen); +#if SDL_VIDEO_OPENGL_METALANGLE + MGLSharegroup *sharegroup = nil; +#else EAGLSharegroup *sharegroup = nil; +#endif CGFloat scale = 1.0; int samples = 0; int major = _this->gl_config.major_version; @@ -148,7 +161,11 @@ int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) /* The EAGLRenderingAPI enum values currently map 1:1 to major GLES * versions. */ +#if SDL_VIDEO_OPENGL_METALANGLE + MGLRenderingAPI api = major; +#else EAGLRenderingAPI api = major; +#endif /* iOS currently doesn't support GLES >3.0. iOS 6 also only supports up * to GLES 2.0. */ @@ -162,7 +179,11 @@ int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) } if (_this->gl_config.share_with_current_context) { +#if SDL_VIDEO_OPENGL_METALANGLE + MGLContext *context = (__bridge MGLContext *) SDL_GL_GetCurrentContext(); +#else EAGLContext *context = (__bridge EAGLContext *) SDL_GL_GetCurrentContext(); +#endif sharegroup = context.sharegroup; } @@ -237,10 +258,17 @@ int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) finished running its own code for the frame. If this isn't done, the app may crash or have other nasty symptoms when Dictation is used. */ +#if SDL_VIDEO_OPENGL_METALANGLE + MGLContext *context = (__bridge MGLContext *) SDL_GL_GetCurrentContext(); + if (context != NULL && [MGLContext currentContext] != context) { + [MGLContext setCurrentContext:context]; + } +#else EAGLContext *context = (__bridge EAGLContext *) SDL_GL_GetCurrentContext(); if (context != NULL && [EAGLContext currentContext] != context) { [EAGLContext setCurrentContext:context]; } +#endif } } diff --git a/src/video/uikit/SDL_uikitopenglview.h b/src/video/uikit/SDL_uikitopenglview.h index 4cd19ce2bbefb..8804381825e93 100644 --- a/src/video/uikit/SDL_uikitopenglview.h +++ b/src/video/uikit/SDL_uikitopenglview.h @@ -22,8 +22,12 @@ #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 #import +#if SDL_VIDEO_OPENGL_METALANGLE +#import +#else #import #import +#endif #import "SDL_uikitview.h" #include "SDL_uikitvideo.h" @@ -41,9 +45,17 @@ stencilBits:(int)stencilBits sRGB:(BOOL)sRGB multisamples:(int)multisamples +#if SDL_VIDEO_OPENGL_METALANGLE + context:(MGLContext *)glcontext; +#else context:(EAGLContext *)glcontext; +#endif +#if SDL_VIDEO_OPENGL_METALANGLE +@property (nonatomic, readonly, weak) MGLContext *context; +#else @property (nonatomic, readonly, weak) EAGLContext *context; +#endif /* The width and height of the drawable in pixels (as opposed to points.) */ @property (nonatomic, readonly) int backingWidth; diff --git a/src/video/uikit/SDL_uikitopenglview.m b/src/video/uikit/SDL_uikitopenglview.m index eac7a12b62e8d..804ed55af19ef 100644 --- a/src/video/uikit/SDL_uikitopenglview.m +++ b/src/video/uikit/SDL_uikitopenglview.m @@ -22,8 +22,15 @@ #if SDL_VIDEO_DRIVER_UIKIT && (SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2) +#if SDL_VIDEO_OPENGL_METALANGLE +#import +#import +#import +#import +#else #include #include +#endif #import "SDL_uikitopenglview.h" #include "SDL_uikitwindow.h" @@ -54,7 +61,11 @@ @implementation SDL_uikitopenglview { + (Class)layerClass { +#if SDL_VIDEO_OPENGL_METALANGLE + return [MGLLayer class]; +#else return [CAEAGLLayer class]; +#endif } - (instancetype)initWithFrame:(CGRect)frame @@ -68,22 +79,31 @@ - (instancetype)initWithFrame:(CGRect)frame stencilBits:(int)stencilBits sRGB:(BOOL)sRGB multisamples:(int)multisamples +#if SDL_VIDEO_OPENGL_METALANGLE + context:(MGLContext *)glcontext +#else context:(EAGLContext *)glcontext +#endif { if ((self = [super initWithFrame:frame])) { const BOOL useStencilBuffer = (stencilBits != 0); const BOOL useDepthBuffer = (depthBits != 0); +#if SDL_VIDEO_OPENGL_METALANGLE + int colorFormat; +#else NSString *colorFormat = nil; +#endif context = glcontext; samples = multisamples; retainedBacking = retained; +#if !SDL_VIDEO_OPENGL_METALANGLE if (!context || ![EAGLContext setCurrentContext:context]) { SDL_SetError("Could not create OpenGL ES drawable (could not make context current)"); return nil; } - +#endif if (samples > 0) { GLint maxsamples = 0; glGetIntegerv(GL_MAX_SAMPLES, &maxsamples); @@ -92,6 +112,24 @@ - (instancetype)initWithFrame:(CGRect)frame samples = MIN(samples, maxsamples); } +#if SDL_VIDEO_OPENGL_METALANGLE + if (sRGB) { + colorFormat = MGLDrawableColorFormatSRGBA8888; + } else if (rBits >= 8 || gBits >= 8 || bBits >= 8 || aBits > 0) { + /* if user specifically requests rbg888 or some color format higher than 16bpp */ + colorFormat = MGLDrawableColorFormatRGBA8888; + } else { + /* default case (potentially faster) */ + colorFormat = MGLDrawableColorFormatRGB565; + } + + MGLLayer *eaglLayer = (MGLLayer *)self.layer; + + eaglLayer.drawableColorFormat = colorFormat; + eaglLayer.retainedBacking = retained; + eaglLayer.contentsScale = scale; + +#else if (sRGB) { /* sRGB EAGL drawable support was added in iOS 7. */ if (UIKit_IsSystemVersionAtLeast(7.0)) { @@ -113,15 +151,42 @@ - (instancetype)initWithFrame:(CGRect)frame CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer; - eaglLayer.opaque = YES; eaglLayer.drawableProperties = @{ kEAGLDrawablePropertyRetainedBacking:@(retained), kEAGLDrawablePropertyColorFormat:colorFormat }; +#endif + + eaglLayer.opaque = YES; + + /* Set the appropriate scale (for retina display support) */ self.contentScaleFactor = scale; +#if SDL_VIDEO_OPENGL_METALANGLE + if (!context || ![MGLContext setCurrentContext:context]) { + SDL_SetError("Could not create OpenGL ES drawable (could not make context current)"); + return nil; + } + + viewFramebuffer = eaglLayer.defaultOpenGLFrameBufferID; + backingWidth = eaglLayer.drawableSize.width; + backingHeight = eaglLayer.drawableSize.height; + + if (samples > 0) { + eaglLayer.drawableMultisample = samples; + } + + if (useDepthBuffer || useStencilBuffer) { + if (useDepthBuffer) { + eaglLayer.drawableDepthFormat = MGLDrawableDepthFormat16; + } + if (useStencilBuffer) { + eaglLayer.drawableStencilFormat = MGLDrawableStencilFormat8; + } + } +#else /* Create the color Renderbuffer Object */ glGenRenderbuffers(1, &viewRenderbuffer); glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer); @@ -193,7 +258,7 @@ - (instancetype)initWithFrame:(CGRect)frame } glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer); - +#endif [self setDebugLabels]; } @@ -207,16 +272,23 @@ - (GLuint)drawableRenderbuffer - (GLuint)drawableFramebuffer { +#if SDL_VIDEO_OPENGL_METALANGLE + return viewFramebuffer; +#else /* When MSAA is used, the MSAA draw framebuffer is used for drawing. */ if (msaaFramebuffer) { return msaaFramebuffer; } else { return viewFramebuffer; } +#endif } - (GLuint)msaaResolveFramebuffer { +#if SDL_VIDEO_OPENGL_METALANGLE + return viewFramebuffer; +#else /* When MSAA is used, the MSAA draw framebuffer is used for drawing and the * view framebuffer is used as a MSAA resolve framebuffer. */ if (msaaFramebuffer) { @@ -224,10 +296,12 @@ - (GLuint)msaaResolveFramebuffer } else { return 0; } +#endif } - (void)updateFrame { +#if !SDL_VIDEO_OPENGL_METALANGLE GLint prevRenderbuffer = 0; glGetIntegerv(GL_RENDERBUFFER_BINDING, &prevRenderbuffer); @@ -253,10 +327,12 @@ - (void)updateFrame } glBindRenderbuffer(GL_RENDERBUFFER, prevRenderbuffer); +#endif } - (void)setDebugLabels { +#if !SDL_VIDEO_OPENGL_METALANGLE if (viewFramebuffer != 0) { glLabelObjectEXT(GL_FRAMEBUFFER, viewFramebuffer, 0, "context FBO"); } @@ -280,10 +356,16 @@ - (void)setDebugLabels if (msaaRenderbuffer != 0) { glLabelObjectEXT(GL_RENDERBUFFER, msaaRenderbuffer, 0, "context MSAA renderbuffer"); } +#endif } - (void)swapBuffers { +#if SDL_VIDEO_OPENGL_METALANGLE + MGLLayer *eaglLayer = (MGLLayer *)self.layer; + [MGLContext setCurrentContext:context forLayer:eaglLayer]; + [context present:eaglLayer]; +#else if (msaaFramebuffer) { const GLenum attachments[] = {GL_COLOR_ATTACHMENT0}; @@ -317,6 +399,7 @@ - (void)swapBuffers * else is responsible for rebinding viewRenderbuffer, to reduce duplicate * state changes. */ [context presentRenderbuffer:GL_RENDERBUFFER]; +#endif } - (void)layoutSubviews @@ -328,6 +411,12 @@ - (void)layoutSubviews /* Update the color and depth buffer storage if the layer size has changed. */ if (width != backingWidth || height != backingHeight) { +#if SDL_VIDEO_OPENGL_METALANGLE + MGLLayer *eaglLayer = (MGLLayer *)self.layer; + [MGLContext setCurrentContext:context forLayer:eaglLayer]; + backingWidth = eaglLayer.drawableSize.width; + backingHeight = eaglLayer.drawableSize.height; +#else EAGLContext *prevContext = [EAGLContext currentContext]; if (prevContext != context) { [EAGLContext setCurrentContext:context]; @@ -338,11 +427,14 @@ - (void)layoutSubviews if (prevContext != context) { [EAGLContext setCurrentContext:prevContext]; } + +#endif } } - (void)destroyFramebuffer { +#if !SDL_VIDEO_OPENGL_METALANGLE if (viewFramebuffer != 0) { glDeleteFramebuffers(1, &viewFramebuffer); viewFramebuffer = 0; @@ -367,14 +459,21 @@ - (void)destroyFramebuffer glDeleteRenderbuffers(1, &msaaRenderbuffer); msaaRenderbuffer = 0; } +#endif } - (void)dealloc { +#if SDL_VIDEO_OPENGL_METALANGLE + if (context && context == [MGLContext currentContext]) { + [MGLContext setCurrentContext:nil]; + } +#else if (context && context == [EAGLContext currentContext]) { [self destroyFramebuffer]; [EAGLContext setCurrentContext:nil]; } +#endif } @end diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index f62815dfe3dd5..f302e6494f811 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -36,7 +36,6 @@ #include "SDL_uikitmodes.h" #include "SDL_uikitwindow.h" #include "SDL_uikitopengles.h" -#include "SDL_uikitmetalangle.h" #include "SDL_uikitclipboard.h" #include "SDL_uikitvulkan.h" #include "SDL_uikitmetalview.h" @@ -112,7 +111,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) device->HasClipboardText = UIKit_HasClipboardText; /* OpenGL (ES) functions */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 device->GL_MakeCurrent = UIKit_GL_MakeCurrent; device->GL_GetDrawableSize = UIKit_GL_GetDrawableSize; device->GL_SwapWindow = UIKit_GL_SwapWindow; diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index dd11b416df9ad..7b677e98336b9 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -33,7 +33,6 @@ #include "SDL_uikitmodes.h" #include "SDL_uikitwindow.h" #include "SDL_uikitopengles.h" -#include "SDL_uikitmetalangle.h" #if SDL_IPHONE_KEYBOARD #include "keyinfotable.h" @@ -180,7 +179,7 @@ - (void)doLoop:(CADisplayLink*)sender /* Don't run the game loop while a messagebox is up */ if (!UIKit_ShowingMessageBox()) { /* See the comment in the function definition. */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_METALANGLE +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 UIKit_GL_RestoreCurrentContext(); #endif diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index d02b6b2dd6717..39e51813b78ac 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -37,12 +37,7 @@ #import "SDL_uikitappdelegate.h" #import "SDL_uikitview.h" - -#if SDL_VIDEO_METALANGLE -#import "SDL_uikitmetalangleview.h" -#else -#import"SDL_uikitopenglview.h" -#endif +#import "SDL_uikitopenglview.h" #include @@ -375,13 +370,6 @@ - (void)layoutSubviews info->info.uikit.colorbuffer = glview.drawableRenderbuffer; info->info.uikit.resolveFramebuffer = glview.msaaResolveFramebuffer; } else { -#elif SDL_VIDEO_METALANGLE - if ([data.viewcontroller.view isKindOfClass:[SDL_uikitmetalangleview class]]) { - SDL_uikitmetalangleview *glview = (SDL_uikitmetalangleview *)data.viewcontroller.view; - info->info.uikit.framebuffer = glview.drawableFramebuffer; - info->info.uikit.colorbuffer = glview.drawableRenderbuffer; - info->info.uikit.resolveFramebuffer = glview.msaaResolveFramebuffer; - } else { #else { #endif