Merge branch 'main' into feature/texture_displacement

This commit is contained in:
SoftFever
2026-09-22 14:46:36 +08:00
committed by GitHub
1059 changed files with 150432 additions and 10431 deletions
+30 -2
View File
@@ -590,11 +590,39 @@ void ImGuiWrapper::new_frame()
// BBL: end copy & paste
}
void ImGuiWrapper::render()
ImDrawData* ImGuiWrapper::end_frame()
{
ImGui::Render();
render_draw_data(ImGui::GetDrawData());
m_new_frame_open = false;
return ImGui::GetDrawData();
}
void ImGuiWrapper::render(ImDrawData* draw_data)
{
render_draw_data(draw_data);
}
ImGuiID ImGuiWrapper::draw_data_signature(const ImDrawData* draw_data)
{
ImGuiID hash = 0;
if (draw_data == nullptr)
return hash;
for (int i = 0; i < draw_data->CmdListsCount; ++i) {
const ImDrawList* list = draw_data->CmdLists[i];
hash = ImHashData(list->VtxBuffer.Data, list->VtxBuffer.Size * sizeof(ImDrawVert), hash);
hash = ImHashData(list->IdxBuffer.Data, list->IdxBuffer.Size * sizeof(ImDrawIdx), hash);
// ImDrawCmd has padding, and a hovered ImageButton3() differs only in TextureId.
for (const ImDrawCmd& cmd : list->CmdBuffer) {
hash = ImHashData(&cmd.ClipRect, sizeof(cmd.ClipRect), hash);
hash = ImHashData(&cmd.TextureId, sizeof(cmd.TextureId), hash);
hash = ImHashData(&cmd.VtxOffset, sizeof(cmd.VtxOffset), hash);
hash = ImHashData(&cmd.IdxOffset, sizeof(cmd.IdxOffset), hash);
hash = ImHashData(&cmd.ElemCount, sizeof(cmd.ElemCount), hash);
hash = ImHashData(&cmd.UserCallback, sizeof(cmd.UserCallback), hash);
}
}
return hash;
}
ImVec2 ImGuiWrapper::calc_text_size(std::string_view text,