| SDL_ShowOpenFileDialog(3) | SDL3 FUNCTIONS | SDL_ShowOpenFileDialog(3) |
SDL_ShowOpenFileDialog - Displays a dialog that lets the user select a file on their filesystem.
Defined in SDL3/SDL_dialog.h
#include "SDL3/SDL.h"
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, bool allow_many);
This is an asynchronous function; it will return immediately, and the result will be passed to the callback.
The callback will be invoked with a null-terminated list of files the user chose. The list will be empty if the user canceled the dialog, and it will be NULL if an error occurred.
Note that the callback may be called from a different thread than the one the function was invoked on.
Depending on the platform, the user may be allowed to input paths that don't yet exist.
On Linux, dialogs may require XDG Portals, which requires DBus,
which requires an event-handling loop. Apps that do not use SDL to handle
events should add a call to SDL_PumpEvents
in their main loop.
This function should be called only from the main thread. The callback may be invoked from the same thread or from a different one, depending on the OS's constraints.
This function is available since SDL 3.2.0.
•(3), SDL_DialogFileCallback(3type), •(3), SDL_DialogFileFilter(3type), •(3), SDL_ShowSaveFileDialog(3), •(3), SDL_ShowOpenFolderDialog(3), •(3), SDL_ShowFileDialogWithProperties(3)
| SDL 3.2.10 | Simple Directmedia Layer |