mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
fix: Make sure all textures are destroyed before glfw gets uninitialized
This commit is contained in:
@@ -155,14 +155,18 @@ namespace hex::plugin::builtin {
|
||||
ImGui::NewLine();
|
||||
|
||||
struct DonationPage {
|
||||
ImGuiExt::Texture texture;
|
||||
const char *link;
|
||||
DonationPage(const std::fs::path &path, const std::string &link) :
|
||||
texture(ImGuiExt::Texture::fromImage(romfs::get(path).span<std::byte>(), ImGuiExt::Texture::Filter::Linear)),
|
||||
link(std::move(link)) { }
|
||||
|
||||
AutoReset<ImGuiExt::Texture> texture;
|
||||
std::string link;
|
||||
};
|
||||
|
||||
static std::array DonationPages = {
|
||||
DonationPage { ImGuiExt::Texture::fromImage(romfs::get("assets/common/donation/paypal.png").span<std::byte>(), ImGuiExt::Texture::Filter::Linear), "https://werwolv.net/donate" },
|
||||
DonationPage { ImGuiExt::Texture::fromImage(romfs::get("assets/common/donation/github.png").span<std::byte>(), ImGuiExt::Texture::Filter::Linear), "https://github.com/sponsors/WerWolv" },
|
||||
DonationPage { ImGuiExt::Texture::fromImage(romfs::get("assets/common/donation/patreon.png").span<std::byte>(), ImGuiExt::Texture::Filter::Linear), "https://patreon.com/werwolv" },
|
||||
DonationPage("assets/common/donation/paypal.png", "https://werwolv.net/donate"),
|
||||
DonationPage("assets/common/donation/github.png", "https://github.com/sponsors/WerWolv"),
|
||||
DonationPage("assets/common/donation/patreon.png", "https://patreon.com/werwolv")
|
||||
};
|
||||
|
||||
if (ImGui::BeginTable("DonationLinks", 5, ImGuiTableFlags_SizingStretchSame)) {
|
||||
@@ -172,9 +176,9 @@ namespace hex::plugin::builtin {
|
||||
for (const auto &page : DonationPages) {
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
const auto size = page.texture.getSize() / 1.5F;
|
||||
const auto size = page.texture->getSize() / 1.5F;
|
||||
const auto startPos = ImGui::GetCursorScreenPos();
|
||||
ImGui::Image(page.texture, page.texture.getSize() / 1.5F);
|
||||
ImGui::Image(*page.texture, page.texture->getSize() / 1.5F);
|
||||
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::GetForegroundDrawList()->AddShadowCircle(startPos + size / 2, size.x / 2, ImGui::GetColorU32(ImGuiCol_Button), 100.0F, ImVec2(), ImDrawFlags_ShadowCutOutShapeBackground);
|
||||
|
||||
Reference in New Issue
Block a user