Add support for shader hotreloading

This commit is contained in:
Jérôme Leclercq
2022-03-17 21:36:36 +01:00
parent 667a4a0c08
commit 615509d1ba
16 changed files with 285 additions and 40 deletions

View File

@@ -20,6 +20,8 @@ namespace Nz
// std::string is assumed to contains UTF-8
NAZARA_CORE_API std::size_t ComputeCharacterCount(const std::string_view& str);
inline bool EndsWith(const std::string_view& str, const std::string_view& s);
NAZARA_CORE_API std::string FromUtf16String(const std::u16string_view& u16str);
NAZARA_CORE_API std::string FromUtf32String(const std::u32string_view& u32str);
NAZARA_CORE_API std::string FromWideString(const std::wstring_view& str);

View File

@@ -10,6 +10,20 @@
namespace Nz
{
inline bool EndsWith(const std::string_view& str, const std::string_view& s)
{
//FIXME: Replace with proper C++20 value once it's available
#if __cplusplus > 201703L
// C++20
return str.ends_with(s);
#else
if (s.size() > str.size())
return false;
return str.compare(str.size() - s.size(), s.size(), s.data()) == 0;
#endif
}
inline bool IsNumber(std::string_view str)
{
if (str.empty())