harfang3d/harfang/platform/platform.h

33 lines
980 B
C
Raw Normal View History

2021-10-13 12:40:31 +00:00
// HARFANG(R) Copyright (C) 2021 Emmanuel Julien, NWNC HARFANG. Released under GPL/LGPL/Commercial Licence, see licence.txt for details.
#pragma once
#include <string>
2022-05-02 15:25:11 +00:00
#include <vector>
2021-10-13 12:40:31 +00:00
namespace hg {
/// Return the platform locale.
std::string GetPlatformLocale();
2022-05-02 15:25:11 +00:00
/// File filter.
struct FileFilter {
std::string name;
std::string pattern;
};
2021-10-13 12:40:31 +00:00
/// Open a file dialog
bool OpenFolderDialog(const std::string &title, std::string &output, const std::string &initial_dir = {});
/// Open a file dialog
2022-05-02 15:25:11 +00:00
bool OpenFileDialog(const std::string &title, const std::vector<FileFilter> &filters, std::string &output, const std::string &initial_dir = {});
2021-10-13 12:40:31 +00:00
/// Open a save file dialog
2022-05-02 15:25:11 +00:00
bool SaveFileDialog(const std::string &title, const std::vector<FileFilter> &filters, std::string &output, const std::string &initial_dir = {});
2021-10-13 12:40:31 +00:00
/// Platform specific initialization.
bool InitPlatform();
/// Drop to the debugger, throws an exception otherwise.
void DebugBreak();
} // namespace hg