mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Added support for SVG loading, improved texture loading API
This commit is contained in:
@@ -783,7 +783,7 @@ namespace hex::plugin::visualizers {
|
||||
vertexArray.bind();
|
||||
if (s_shouldUpdateTexture) {
|
||||
s_shouldUpdateTexture = false;
|
||||
s_modelTexture = ImGuiExt::Texture(s_texturePath, ImGuiExt::Texture::Filter::Nearest);
|
||||
s_modelTexture = ImGuiExt::Texture::fromImage(s_texturePath, ImGuiExt::Texture::Filter::Nearest);
|
||||
}
|
||||
|
||||
if (s_drawTexture)
|
||||
@@ -899,7 +899,7 @@ namespace hex::plugin::visualizers {
|
||||
vertexArray.unbind();
|
||||
frameBuffer.unbind();
|
||||
|
||||
s_texture = ImGuiExt::Texture(renderTexture.release(), GLsizei(renderTexture.getWidth()), GLsizei(renderTexture.getHeight()));
|
||||
s_texture = ImGuiExt::Texture::fromGLTexture(renderTexture.release(), GLsizei(renderTexture.getWidth()), GLsizei(renderTexture.getHeight()));
|
||||
|
||||
drawWindow(s_texture, s_renderingWindowSize, mvp);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace hex::plugin::visualizers {
|
||||
static std::mutex addressMutex;
|
||||
static TaskHolder addressTask;
|
||||
|
||||
static auto mapTexture = ImGuiExt::Texture(romfs::get("assets/common/map.jpg").span(), ImGuiExt::Texture::Filter::Linear);
|
||||
static auto mapTexture = ImGuiExt::Texture::fromImage(romfs::get("assets/common/map.jpg").span(), ImGuiExt::Texture::Filter::Linear);
|
||||
static ImVec2 mapSize = scaled(ImVec2(500, 500 / mapTexture.getAspectRatio()));
|
||||
|
||||
if (shouldReset) {
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace hex::plugin::visualizers {
|
||||
auto pattern = arguments[0].toPattern();
|
||||
|
||||
auto data = pattern->getBytes();
|
||||
texture = ImGuiExt::Texture(data.data(), data.size(), ImGuiExt::Texture::Filter::Nearest);
|
||||
texture = ImGuiExt::Texture::fromImage(data.data(), data.size(), ImGuiExt::Texture::Filter::Nearest);
|
||||
scale = 200_scaled / texture.getSize().x;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace hex::plugin::visualizers {
|
||||
auto height = arguments[2].toUnsigned();
|
||||
|
||||
auto data = pattern->getBytes();
|
||||
texture = ImGuiExt::Texture(data.data(), data.size(), ImGuiExt::Texture::Filter::Nearest, width, height);
|
||||
texture = ImGuiExt::Texture::fromBitmap(data.data(), data.size(), width, height, ImGuiExt::Texture::Filter::Nearest);
|
||||
}
|
||||
|
||||
if (texture.isValid())
|
||||
|
||||
Reference in New Issue
Block a user