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 - MacCatalyst build failures
Summary: MacCatalyst build failures
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.0
Hardware: ARM macOS 10.15
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-02 22:58 UTC by C.W. Betts
Modified: 2021-01-03 18:33 UTC (History)
0 users

See Also:


Attachments
Mac Catalyst build patch (4.38 KB, patch)
2021-01-02 22:58 UTC, C.W. Betts
Details | Diff
Set Metal as the default renderer on Mac Catalyst (921 bytes, patch)
2021-01-02 23:57 UTC, C.W. Betts
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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