MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / saveFileDialog

Method saveFileDialog

Simulator/SimulatorBase.cpp:2823–2849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2821}
2822
2823std::string SimulatorBase::saveFileDialog(const std::string& defaultPath, const std::string &defaultName, const std::string filterName, const std::string fileFilter)
2824{
2825 std::string fileName = "";
2826#ifdef USE_NFD_FILE_DIALOG
2827 NFD_Init();
2828
2829 nfdchar_t* outPath;
2830 nfdfilteritem_t filterItem[1] = { { filterName.c_str(), fileFilter.c_str() } };
2831 nfdresult_t result = NFD_SaveDialog(&outPath, filterItem, 1, defaultPath.c_str(), defaultName.c_str());
2832 if (result == NFD_OKAY)
2833 {
2834 fileName = outPath;
2835 NFD_FreePath(outPath);
2836 }
2837 else if (result == NFD_CANCEL)
2838 {
2839 }
2840 else
2841 {
2842 LOG_ERR << "Error: " << NFD_GetError();
2843 }
2844
2845 NFD_Quit();
2846#endif
2847
2848 return fileName;
2849}
2850
2851void SimulatorBase::writeScene()
2852{

Callers

nothing calls this directly

Calls 4

NFD_InitFunction · 0.50
NFD_GetErrorFunction · 0.50
NFD_QuitFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected