Merge commit '6e9eb898f5c6e241591d4953ae0b36668cd59f94' as 'external/nfd'

This commit is contained in:
SimoZ64
2025-05-04 00:37:23 +02:00
48 changed files with 8052 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#include <iostream>
#include "nfd.hpp"
/* this test should compile on all supported platforms */
/* this demonstrates the thin C++ wrapper */
int main() {
// initialize NFD
NFD::Guard nfdGuard;
// auto-freeing memory
NFD::UniquePath outPath;
// prepare filters for the dialog
nfdfilteritem_t filterItem[2] = {{"Source code", "c,cpp,cc"}, {"Headers", "h,hpp"}};
// show the dialog
nfdresult_t result = NFD::OpenDialog(outPath, filterItem, 2);
if (result == NFD_OKAY) {
std::cout << "Success!" << std::endl << outPath.get() << std::endl;
} else if (result == NFD_CANCEL) {
std::cout << "User pressed cancel." << std::endl;
} else {
std::cout << "Error: " << NFD::GetError() << std::endl;
}
// NFD::Guard will automatically quit NFD.
return 0;
}