From 0b0770ed39bb82c8304baaaf9b0f514601785838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 4 Jul 2018 13:36:14 -0700 Subject: [PATCH] texturev: Added image info to menu bar. --- tools/texturev/texturev.cpp | 41 +++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index b0efb697b..2f1c77c2e 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -1473,6 +1473,40 @@ int _main_(int _argc, char** _argv) ImGui::EndMenu(); } + if (0 != view.m_fileList.size() ) + { + ImGui::Separator(); + ImGui::TextColored( + ImVec4(0.0f, 1.0f, 1.0f, 1.0f) + , view.m_fileList[view.m_fileIndex].c_str() + ); + + ImGui::Separator(); + const char* name = ""; + if (view.m_textureInfo.cubeMap) + { + name = " CubeMap"; + } + else if (1 < view.m_textureInfo.depth) + { + name = " 3D"; + view.m_textureInfo.numLayers = view.m_textureInfo.depth; + } + else if (1 < view.m_textureInfo.numLayers) + { + name = " 2D Array"; + } + + ImGui::Text("%d x %d%s, mips: %d, layers %d, %s" + , view.m_textureInfo.width + , view.m_textureInfo.height + , name + , view.m_textureInfo.numMips + , view.m_textureInfo.numLayers + , bimg::getName(bimg::TextureFormat::Enum(view.m_textureInfo.format) ) + ); + } + ImGui::EndMainMenuBar(); } @@ -1561,7 +1595,7 @@ int _main_(int _argc, char** _argv) if (view.m_info) { ImGui::SetNextWindowSize( - ImVec2(300.0f, 300.0f) + ImVec2(300.0f, 320.0f) , ImGuiCond_FirstUseEver ); @@ -1575,6 +1609,8 @@ int _main_(int _argc, char** _argv) } else { + ImGui::Text("Name: %s", view.m_fileList[view.m_fileIndex].c_str() ); + ImGui::Text("Dimensions: %d x %d" , view.m_textureInfo.width , view.m_textureInfo.height @@ -1637,7 +1673,7 @@ int _main_(int _argc, char** _argv) ImGui::PushItemWidth(-1); if (ImGui::ListBoxHeader("##empty", ImVec2(0.0f, listHeight) ) ) { - const int32_t itemCount = int32_t(view.m_fileList.size() ); + const int32_t itemCount = int32_t(view.m_fileList.size() ); int32_t start, end; ImGui::CalcListClipping(itemCount, itemHeight, &start, &end); @@ -1837,6 +1873,7 @@ int _main_(int _argc, char** _argv) { bx::stringPrintf(title, "Failed to load %s!", filePath); } + entry::WindowHandle handle = { 0 }; entry::setWindowTitle(handle, title.c_str() ); }