Skip to content

Commit

Permalink
fix textures
Browse files Browse the repository at this point in the history
  • Loading branch information
checkraisefold committed Jul 17, 2024
1 parent b6f0ee9 commit 7c9aec9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,13 @@ namespace hex::plugin::visualizers {
if (s_renderingWindowSize.x <= 0 || s_renderingWindowSize.y <= 0)
s_renderingWindowSize = { minSize, minSize };

if (!textureFile.empty())
if (!textureFile.empty()) {
s_texturePath = textureFile;
else
s_drawTexture = true;
}
else {
s_drawTexture = false;
}

s_renderingWindowSize.x = std::max(s_renderingWindowSize.x, minSize);
s_renderingWindowSize.y = std::max(s_renderingWindowSize.y, minSize);
Expand Down Expand Up @@ -795,6 +798,8 @@ namespace hex::plugin::visualizers {
if (s_shouldUpdateTexture) {
s_shouldUpdateTexture = false;
s_modelTexture = ImGuiExt::Texture::fromImage(s_texturePath, ImGuiExt::Texture::Filter::Nearest);
if(s_modelTexture.isValid())
s_drawTexture = true;
}

if (s_drawTexture)
Expand Down

0 comments on commit 7c9aec9

Please sign in to comment.