-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
The new SDL FileDialog API is amazing. I would love to see file choosers on non-desktop platforms, because it would greatly assist users in importing and exporting save data from games, among other things.
UWP has the FileOpenPicker and FolderPicker documented here: https://learn.microsoft.com/en-us/windows/uwp/files/quickstart-using-file-and-folder-pickers. They give sample code in C# but the C++ equivalent is probably very similar. As far as I am aware, this is also supported on UWP for Xbox.
UIKit has the UIDocumentPickerViewController, documented here: https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller. It's available on iOS and visionOS. You can choose folders by passing kUTTypeFolder into the documentTypes parameter of the UIDocumentPickerViewController constructor.
Android has ACTION_OPEN_DOCUMENT and ACTION_OPEN_DOCUMENT_TREE which prompt the system to display a DocumentsProvider and return the chosen items as content:/// URLs. It's documented here: https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT. It may require JNI interop to invoke.