mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:50:05 +00:00
Update ImGui to v1.92.2b
This commit is contained in:
parent
26e7220959
commit
dc96e3e3ad
11 changed files with 35 additions and 108 deletions
|
|
@ -98,10 +98,11 @@ void DrawLayer::ImGuiFrameStart(const std::shared_ptr<MapContext>& mapContext)
|
|||
ImGui::SetCurrentContext(p->imGuiContext_);
|
||||
|
||||
// Start ImGui Frame
|
||||
model::ImGuiContextModel::Instance().NewFrame();
|
||||
ImGui_ImplQt_NewFrame(mapContext->widget());
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
ImGui::PushFont(defaultFont->font());
|
||||
ImGui::PushFont(defaultFont->font(), 0.0f);
|
||||
}
|
||||
|
||||
void DrawLayer::ImGuiFrameEnd()
|
||||
|
|
|
|||
|
|
@ -172,7 +172,6 @@ public:
|
|||
void HandleHotkeyReleased(types::Hotkey hotkey);
|
||||
void HandleHotkeyUpdates();
|
||||
void HandlePinchGesture(QPinchGesture* gesture);
|
||||
void ImGuiCheckFonts();
|
||||
void InitializeCustomStyles();
|
||||
void InitializeNewRadarProductView(const std::string& colorPalette);
|
||||
void RadarProductManagerConnect();
|
||||
|
|
@ -222,8 +221,7 @@ public:
|
|||
|
||||
ImGuiContext* imGuiContext_;
|
||||
std::string imGuiContextName_;
|
||||
bool imGuiRendererInitialized_;
|
||||
std::uint64_t imGuiFontsBuildCount_ {};
|
||||
bool imGuiRendererInitialized_ {false};
|
||||
|
||||
std::shared_ptr<model::LayerModel> layerModel_ {
|
||||
model::LayerModel::Instance()};
|
||||
|
|
@ -1575,8 +1573,6 @@ void MapWidget::initializeGL()
|
|||
ImGui::SetCurrentContext(p->imGuiContext_);
|
||||
ImGui_ImplQt_RegisterWidget(this);
|
||||
ImGui_ImplOpenGL3_Init();
|
||||
p->imGuiFontsBuildCount_ =
|
||||
manager::FontManager::Instance().imgui_fonts_build_count();
|
||||
p->imGuiRendererInitialized_ = true;
|
||||
|
||||
p->map_.reset(
|
||||
|
|
@ -1628,10 +1624,6 @@ void MapWidget::paintGL()
|
|||
std::shared_lock imguiFontAtlasLock {
|
||||
manager::FontManager::Instance().imgui_font_atlas_mutex()};
|
||||
|
||||
// Check ImGui fonts
|
||||
ImGui::SetCurrentContext(p->imGuiContext_);
|
||||
p->ImGuiCheckFonts();
|
||||
|
||||
// Update pixel ratio
|
||||
p->context_->set_pixel_ratio(pixelRatio());
|
||||
|
||||
|
|
@ -1646,12 +1638,13 @@ void MapWidget::paintGL()
|
|||
ImGui::SetCurrentContext(p->imGuiContext_);
|
||||
|
||||
// Start ImGui Frame
|
||||
model::ImGuiContextModel::Instance().NewFrame();
|
||||
ImGui_ImplQt_NewFrame(this);
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
// Set default font
|
||||
ImGui::PushFont(defaultFont->font());
|
||||
ImGui::PushFont(defaultFont->font(), 0.0f);
|
||||
|
||||
// Perform mouse picking
|
||||
if (p->hasMouse_)
|
||||
|
|
@ -1682,30 +1675,6 @@ void MapWidget::paintGL()
|
|||
p->isPainting_ = false;
|
||||
}
|
||||
|
||||
void MapWidgetImpl::ImGuiCheckFonts()
|
||||
{
|
||||
// Update ImGui Fonts if required
|
||||
std::uint64_t currentImGuiFontsBuildCount =
|
||||
manager::FontManager::Instance().imgui_fonts_build_count();
|
||||
|
||||
if (imGuiFontsBuildCount_ != currentImGuiFontsBuildCount ||
|
||||
!model::ImGuiContextModel::Instance().font_atlas()->IsBuilt())
|
||||
{
|
||||
ImGui_ImplOpenGL3_DestroyFontsTexture();
|
||||
ImGui_ImplOpenGL3_CreateFontsTexture();
|
||||
}
|
||||
|
||||
static bool haveLogged = false;
|
||||
if (!model::ImGuiContextModel::Instance().font_atlas()->IsBuilt() &&
|
||||
!haveLogged)
|
||||
{
|
||||
logger_->error("ImGui font atlas could not be built.");
|
||||
haveLogged = true;
|
||||
}
|
||||
|
||||
imGuiFontsBuildCount_ = currentImGuiFontsBuildCount;
|
||||
}
|
||||
|
||||
void MapWidgetImpl::RunMousePicking()
|
||||
{
|
||||
const QMapLibre::CustomLayerRenderParameters params = {
|
||||
|
|
|
|||
|
|
@ -539,7 +539,7 @@ void OverlayLayer::Render(const std::shared_ptr<MapContext>& mapContext,
|
|||
ImVec2 {1.0f, 1.0f});
|
||||
ImGui::SetNextWindowBgAlpha(0.5f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2 {3.0f, 2.0f});
|
||||
ImGui::PushFont(attributionFont->font());
|
||||
ImGui::PushFont(attributionFont->font(), 0.0f);
|
||||
ImGui::Begin("Attribution",
|
||||
nullptr,
|
||||
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue