Minor Update - Fix Warning + Add texture in the object inspector

Feat :

+ Show the texture of the object in the Object Window

Fix :

- No warning for now...
This commit is contained in:
2024-04-09 13:02:33 +02:00
parent 01acf46db8
commit ca82f37127
8 changed files with 102 additions and 78 deletions

View File

@@ -106,6 +106,7 @@ void imguiManager::WidgetObjectWindow(ApplicationClass* app)
{
ImGui::Begin("Objects", &showObjectWindow);
int index = 0;
int count = 0;
for (auto& object : app->GetKobjects())
{
std::string headerName = object->GetName() + " " + std::to_string(index);
@@ -139,6 +140,21 @@ void imguiManager::WidgetObjectWindow(ApplicationClass* app)
ImGui::Separator();
// Texture
std::string textureLabel = "Texture##" + std::to_string(index);
ID3D11ShaderResourceView* texture = object->GetTexture(0);
if (texture != nullptr)
{
if (ImGui::ImageButton((ImTextureID)texture, ImVec2(64, 64)))
{
count++;
}
}
ImGui::Text("Texture count: %d", count);
ImGui::Separator();
// Delete button
std::string deleteLabel = "Delete##" + std::to_string(index);
if (ImGui::Button(deleteLabel.c_str()))