mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:00:05 +00:00
Use layer names in ImGui Context names
This commit is contained in:
parent
ec296d98eb
commit
2be140d291
9 changed files with 38 additions and 25 deletions
|
|
@ -20,11 +20,13 @@ static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
|
|||
class DrawLayerImpl
|
||||
{
|
||||
public:
|
||||
explicit DrawLayerImpl(std::shared_ptr<MapContext> context) :
|
||||
explicit DrawLayerImpl(std::shared_ptr<MapContext> context,
|
||||
const std::string& imGuiContextName) :
|
||||
context_ {std::move(context)}, drawList_ {}
|
||||
{
|
||||
static size_t currentMapId_ {0u};
|
||||
imGuiContextName_ = fmt::format("Layer {}", ++currentMapId_);
|
||||
static size_t currentLayerId_ {0u};
|
||||
imGuiContextName_ =
|
||||
fmt::format("{} {}", imGuiContextName, ++currentLayerId_);
|
||||
// This must be initialized after the last line
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
|
||||
imGuiContext_ =
|
||||
|
|
@ -65,8 +67,10 @@ public:
|
|||
bool imGuiRendererInitialized_ {};
|
||||
};
|
||||
|
||||
DrawLayer::DrawLayer(const std::shared_ptr<MapContext>& context) :
|
||||
GenericLayer(context), p(std::make_unique<DrawLayerImpl>(context))
|
||||
DrawLayer::DrawLayer(const std::shared_ptr<MapContext>& context,
|
||||
const std::string& imGuiContextName) :
|
||||
GenericLayer(context),
|
||||
p(std::make_unique<DrawLayerImpl>(context, imGuiContextName))
|
||||
{
|
||||
}
|
||||
DrawLayer::~DrawLayer() = default;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue