WindowsFileSystem: added SaveFileDialog() function
assiduous
2 years ago
57 | 57 |
|
58 | 58 |
static std::string OpenFileDialog(const char* Title, const char* Filter);
|
59 | 59 |
|
|
60 |
static std::string SaveFileDialog(const char* Title, const char* Filter);
|
|
61 |
|
60 | 62 |
static std::string GetCurrentDirectory();
|
61 | 63 |
|
62 | 64 |
|
295 | 295 |
return FileName;
|
296 | 296 |
}
|
297 | 297 |
|
|
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 |
|
298 | 317 |
bool WindowsFileSystem::IsDirectory(const Diligent::Char* strPath)
|
299 | 318 |
{
|
300 | 319 |
if (!PathExists(strPath))
|