mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:30:05 +00:00
Lock the ImGui font atlas when processing a frame
This commit is contained in:
parent
d3a3c3db36
commit
2e9f5818cd
4 changed files with 27 additions and 0 deletions
|
|
@ -45,12 +45,19 @@ public:
|
|||
const std::vector<std::string>& styles);
|
||||
|
||||
std::string fontCachePath_ {};
|
||||
|
||||
std::shared_mutex imguiFontAtlasMutex_ {};
|
||||
};
|
||||
|
||||
FontManager::FontManager() : p(std::make_unique<Impl>()) {}
|
||||
|
||||
FontManager::~FontManager() {};
|
||||
|
||||
std::shared_mutex& FontManager::imgui_font_atlas_mutex()
|
||||
{
|
||||
return p->imguiFontAtlasMutex_;
|
||||
}
|
||||
|
||||
std::shared_ptr<types::ImGuiFont>
|
||||
FontManager::GetImGuiFont(const std::string& family,
|
||||
const std::vector<std::string>& styles,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include <scwx/qt/types/imgui_font.hpp>
|
||||
|
||||
#include <shared_mutex>
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace scwx
|
||||
|
|
@ -19,6 +21,8 @@ public:
|
|||
explicit FontManager();
|
||||
~FontManager();
|
||||
|
||||
std::shared_mutex& imgui_font_atlas_mutex();
|
||||
|
||||
std::shared_ptr<types::ImGuiFont>
|
||||
GetImGuiFont(const std::string& family,
|
||||
const std::vector<std::string>& styles,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue