Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ NFD_OpenDialog()

static unsafe nfdresult_t nativefiledialog.NFD_OpenDialog ( string filterList,
string defaultPath,
out string outPath )
inlinestatic

Definition at line 76 of file nativefiledialog.cs.

77 {
78 byte* intPtr = Utf8EncodeNullable(filterList);
79 byte* ptr = Utf8EncodeNullable(defaultPath);
80 IntPtr outPath2;
81 nfdresult_t result = INTERNAL_NFD_OpenDialog(intPtr, ptr, out outPath2);
82 Marshal.FreeHGlobal((IntPtr)intPtr);
84 outPath = UTF8_ToManaged(outPath2, freePtr: true);
85 return result;
86 }
static void FreeHGlobal(IntPtr hglobal)
Definition Marshal.cs:1680
static unsafe nfdresult_t INTERNAL_NFD_OpenDialog(byte *filterList, byte *defaultPath, out IntPtr outPath)
static unsafe string UTF8_ToManaged(IntPtr s, bool freePtr=false)
static unsafe byte * Utf8EncodeNullable(string str)

References System.Runtime.InteropServices.Marshal.FreeHGlobal(), INTERNAL_NFD_OpenDialog(), UTF8_ToManaged(), and Utf8EncodeNullable().

Referenced by Terraria.Utilities.FileBrowser.NativeFileDialog.OpenFilePanel().