Fix locale issue when writing WaveFront OBJ files

This commit is contained in:
Chuck Walbourn 2021-11-05 18:51:26 -07:00
parent 4cea8eb563
commit 30c839cfb7

View File

@ -26,6 +26,7 @@
#include <cwchar>
#include <iterator>
#include <locale>
#include <new>
using namespace DirectX;
@ -185,6 +186,8 @@ HRESULT Mesh::ExportToOBJ(const wchar_t* szFileName, size_t nMaterials, const Ma
_Use_decl_annotations_
void Mesh::ExportToOBJ(std::wostream& os, size_t nMaterials, const Material* materials) const
{
os.imbue(std::locale::classic());
if (!mtlFileName.empty())
os << L"mtllib ./" << mtlFileName << L".mtl" << std::endl;