From 005ce358ed7b4a9ba5513ac12997c7ac83cdb970 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Sun, 12 Jun 2016 20:06:44 -0400 Subject: [PATCH] OSX fixes --- src/util/GLFont.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/util/GLFont.cpp b/src/util/GLFont.cpp index 1e76895..b81fcf3 100644 --- a/src/util/GLFont.cpp +++ b/src/util/GLFont.cpp @@ -197,13 +197,13 @@ void GLFont::loadFont(const std::wstring& fontFile) { std::wifstream input; - input.open(fontFileSource.c_str(), std::ios::in); + std::string inpFileStr(fontFileSource.begin(), fontFileSource.end()); + input.open(inpFileStr, std::ios::in); std::wstring op; while (!input.eof()) { input >> op; - if (op == L"info") { std::wstring info_param_str; getline(input, info_param_str); @@ -569,8 +569,13 @@ void GLFont::drawString(const std::wstring& str, float xpos, float ypos, int pxH // Draw string, immediate, 8 bit version void GLFont::drawString(const std::string& str, float xpos, float ypos, int pxHeight, Align hAlign, Align vAlign, int vpx, int vpy, bool cacheable) { - //This a thread-safe wsTmp buffer to convert to wstring, reusing the same memory +#ifdef WIN32 + //This a thread-safe wsTmp buffer to convert to wstring, reusing the same memory, unsupported: OSX? static thread_local std::wstring wsTmp; +#else + std::wstring wsTmp; +#endif + wsTmp.clear(); wsTmp.assign(str.begin(), str.end());