fix transform commit shader
This commit is contained in:
20
src/util.cpp
20
src/util.cpp
@@ -293,6 +293,26 @@ std::string unescape(const std::string& s)
|
||||
return res;
|
||||
}
|
||||
|
||||
std::wstring str2wstr(const std::string& str)
|
||||
{
|
||||
mbstate_t st = {};
|
||||
std::wstring converted;
|
||||
converted.resize(str.size());
|
||||
const char* ptr = str.c_str();
|
||||
std::mbsrtowcs((wchar_t*)converted.data(), &ptr, converted.capacity(), &st);
|
||||
return converted;
|
||||
}
|
||||
|
||||
std::string wstr2str(const std::wstring & wstr)
|
||||
{
|
||||
mbstate_t st = {};
|
||||
std::string converted;
|
||||
converted.resize(wstr.size());
|
||||
const wchar_t * wptr = wstr.c_str();
|
||||
std::wcsrtombs((char*)converted.data(), &wptr, converted.capacity(), &st);
|
||||
return converted;
|
||||
}
|
||||
|
||||
static const char* gl2str(GLenum err)
|
||||
{
|
||||
switch (err)
|
||||
|
||||
Reference in New Issue
Block a user