git.s-ol.nu forks/DiligentCore / abae43d
WindowsFileSystem: added SaveFileDialog() function assiduous 2 years ago
2 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
5757
5858 static std::string OpenFileDialog(const char* Title, const char* Filter);
5959
60 static std::string SaveFileDialog(const char* Title, const char* Filter);
61
6062 static std::string GetCurrentDirectory();
6163
6264
295295 return FileName;
296296 }
297297
298 std::string WindowsFileSystem::SaveFileDialog(const char* Title, const char* Filter)
299 {
300 std::string FileName;
301 char buffer[1024] = {};
302 OPENFILENAMEA ofn = {};
303 ofn.lStructSize = sizeof(ofn);
304 ofn.lpstrFilter = Filter;
305 ofn.lpstrFile = buffer;
306 ofn.nMaxFile = _countof(buffer);
307 ofn.lpstrTitle = Title;
308 ofn.Flags = OFN_DONTADDTORECENT | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR;
309 if (GetSaveFileNameA(&ofn))
310 {
311 FileName = buffer;
312 }
313 return FileName;
314 }
315
316
298317 bool WindowsFileSystem::IsDirectory(const Diligent::Char* strPath)
299318 {
300319 if (!PathExists(strPath))