Use extended-params version of NFD functions.

This commit is contained in:
Bartosz Taudul
2026-07-02 00:46:30 +02:00
parent 280af2e7bd
commit 641bd09b6f

View File

@@ -77,7 +77,11 @@ static bool OpenFileImpl( const char* ext, const char* desc, const std::function
# else
nfdu8filteritem_t filter = { desc, ext };
nfdu8char_t* fn;
const auto res = NFD_OpenDialogU8( &fn, &filter, 1, nullptr );
const nfdopendialogu8args_t args = {
.filterList = &filter,
.filterCount = 1,
};
const auto res = NFD_OpenDialogU8_With( &fn, &args );
if( res == NFD_OKAY )
{
callback( (const char*)fn );
@@ -98,7 +102,11 @@ static bool SaveFileImpl( const char* ext, const char* desc, const std::function
#if !defined TRACY_NO_FILESELECTOR && !defined __EMSCRIPTEN__
nfdu8filteritem_t filter = { desc, ext };
nfdu8char_t* fn;
const auto res = NFD_SaveDialogU8( &fn, &filter, 1, nullptr, nullptr );
const nfdsavedialogu8args_t args = {
.filterList = &filter,
.filterCount = 1,
};
const auto res = NFD_SaveDialogU8_With( &fn, &args );
if( res == NFD_OKAY )
{
callback( (const char*)fn );