feat: add selection to meshrendercomponent
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <destrum/Scene/SceneManager.h>
|
||||
#include <destrum/Serialization/SceneSerializer.h>
|
||||
#include <destrum/Util/DeltaTime.h>
|
||||
#include <destrum/Util/ImGuiUtils.h>
|
||||
|
||||
#include "imgui.h"
|
||||
#include "imgui_internal.h"
|
||||
@@ -261,6 +262,11 @@ if (!isRunning) break;
|
||||
drawPhysicsPanel(dt, fixedDt, accumulator);
|
||||
}
|
||||
|
||||
if (m_DebugWindows.assets)
|
||||
{
|
||||
m_AssetBrowser.Draw(&m_DebugWindows.assets);
|
||||
}
|
||||
|
||||
if (m_DebugWindows.imageCache)
|
||||
{
|
||||
m_ResourcesInspector.drawImageCacheWindow(&m_DebugWindows.imageCache, resources, imguiPass);
|
||||
@@ -450,6 +456,7 @@ void App::drawWindowsMenu()
|
||||
ImGui::MenuItem("Physics", nullptr, &m_DebugWindows.physics);
|
||||
ImGui::MenuItem("Inspector", nullptr, &m_DebugWindows.inspector);
|
||||
ImGui::MenuItem("Image Cache", nullptr, &m_DebugWindows.imageCache);
|
||||
ImGui::MenuItem("Assets", nullptr, &m_DebugWindows.assets);
|
||||
|
||||
customWindowsMenu();
|
||||
|
||||
@@ -480,11 +487,13 @@ void App::drawDockSpace()
|
||||
ImGuiID center = dockspaceId;
|
||||
const ImGuiID right = ImGui::DockBuilderSplitNode(center, ImGuiDir_Right, 0.25f, nullptr, ¢er);
|
||||
const ImGuiID left = ImGui::DockBuilderSplitNode(center, ImGuiDir_Left, 0.22f, nullptr, ¢er);
|
||||
const ImGuiID bottom = ImGui::DockBuilderSplitNode(center, ImGuiDir_Down, 0.28f, nullptr, ¢er);
|
||||
|
||||
ImGui::DockBuilderDockWindow("Viewport", center);
|
||||
ImGui::DockBuilderDockWindow("Inspector", right);
|
||||
ImGui::DockBuilderDockWindow("Debug", left);
|
||||
ImGui::DockBuilderDockWindow("Physics", left);
|
||||
ImGui::DockBuilderDockWindow("Assets", bottom);
|
||||
ImGui::DockBuilderFinish(dockspaceId);
|
||||
}
|
||||
|
||||
@@ -520,6 +529,14 @@ void App::drawViewportWindow()
|
||||
if (const ImTextureID texture = imguiPass.getFrameTexture(drawImage.imageView); texture != ImTextureID{})
|
||||
{
|
||||
ImGui::Image(texture, ImVec2{viewportRect.size.x, viewportRect.size.y});
|
||||
if (ImGui::BeginDragDropTarget())
|
||||
{
|
||||
if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(ImGuiUtils::AssetPayload))
|
||||
{
|
||||
onViewportAssetDropped(static_cast<const char*>(payload->Data));
|
||||
}
|
||||
ImGui::EndDragDropTarget();
|
||||
}
|
||||
}
|
||||
|
||||
viewportHovered = ImGui::IsWindowHovered();
|
||||
|
||||
Reference in New Issue
Block a user