We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5440

Summary: MacCatalyst build failures
Product: SDL Reporter: C.W. Betts <computers57>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: ARM   
OS: macOS 10.15   
Attachments: Mac Catalyst build patch
Set Metal as the default renderer on Mac Catalyst

Description C.W. Betts 2021-01-02 22:58:09 UTC
Created attachment 4632 [details]
Mac Catalyst build patch

I tested building commit http://hg.libsdl.org/SDL/rev/55cdb379e866 on Mac Catalyst and found some issues:

* MTLFeatureSet_iOS_* enums aren't available under Mac Catalyst.
* OpenGL ES is unavailable under Mac Catalyst.
* Some Metal features are available under Catalyst but not iOS, such as displaySyncEnabled.

Attaching a patch that will make SDL2 build for Mac Catalyst.
Comment 1 C.W. Betts 2021-01-02 23:56:23 UTC
Poking around, I also discovered that, due to defaulting to OpenGL, none of the example apps will show a screen. For Catalyst, Metal needs to be the default renderer. I edited video.c around line 1477 to make Metal the default renderer on Mac Catalyst and it worked fine.
Comment 2 C.W. Betts 2021-01-02 23:57:38 UTC
Created attachment 4633 [details]
Set Metal as the default renderer on Mac Catalyst
Comment 3 C.W. Betts 2021-01-03 03:31:22 UTC
Another issue I've discovered: The UI is unresponsive (beachball), but it still draws. I don't know how this will interact with games, though.
Comment 4 Sam Lantinga 2021-01-03 18:33:49 UTC
Patch tweaked and added, thanks!
https://hg.libsdl.org/SDL/rev/50f265303173