Fixed UI Rendering #326
|
@ -1,8 +1,11 @@
|
|||
#include "SHpch.h"
|
||||
|
||||
#include <memory>
|
||||
#include <imgui.h>
|
||||
|
||||
#include "Serialization/SHSerializationHelper.hpp"
|
||||
#include "SHMaterialInspector.h"
|
||||
#include "Editor/SHImGuiHelpers.hpp"
|
||||
#include <imgui.h>
|
||||
|
||||
#include "Assets/SHAssetManager.h"
|
||||
#include "Editor/IconsMaterialDesign.h"
|
||||
|
@ -176,7 +179,7 @@ namespace SHADE
|
|||
const std::string VERT_SHADER_NAME = VERT_SHADER_INFO ? VERT_SHADER_INFO->name : "Unknown Shader";
|
||||
isDirty |= SHEditorWidgets::DragDropReadOnlyField<AssetID>
|
||||
(
|
||||
"Fragment Shader", VERT_SHADER_NAME.data(),
|
||||
"Vertex Shader", VERT_SHADER_NAME.data(),
|
||||
[this]() { return currentMatSpec->vertexShader; },
|
||||
[this](const AssetID& id) { currentMatSpec->vertexShader = id; },
|
||||
SHDragDrop::DRAG_RESOURCE
|
||||
|
@ -191,6 +194,37 @@ namespace SHADE
|
|||
SHDragDrop::DRAG_RESOURCE
|
||||
);
|
||||
|
||||
// Subpass
|
||||
const auto& SP_NAMES = SHGraphicsConstants::RenderGraphEntityNames::USABLE_SUBPASSES;
|
||||
ImGui::Text("Subpass");
|
||||
ImGui::SameLine();
|
||||
if (ImGui::BeginCombo("##", currentMatSpec->subpassName.data(), ImGuiComboFlags_None))
|
||||
{
|
||||
for (const auto& NAME : SP_NAMES)
|
||||
{
|
||||
const bool IS_SELECTED = currentMatSpec->subpassName == NAME;
|
||||
if (ImGui::Selectable(NAME.data(), IS_SELECTED))
|
||||
{
|
||||
isDirty = true;
|
||||
SHCommandManager::PerformCommand
|
||||
(
|
||||
std::reinterpret_pointer_cast<SHBaseCommand>(std::make_shared<SHCommand<std::string>>
|
||||
(
|
||||
currentMatSpec->subpassName,
|
||||
std::string(NAME),
|
||||
[&](const std::string& newName){ currentMatSpec->subpassName = newName; }
|
||||
)),
|
||||
false
|
||||
);
|
||||
}
|
||||
if (IS_SELECTED)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
// Load the shader to access it's data
|
||||
auto fragShader = SHResourceManager::LoadOrGet<SHVkShaderModule>(currentMatSpec->fragShader);
|
||||
if (!fragShader)
|
||||
|
|
|
@ -98,9 +98,9 @@ namespace SHADE
|
|||
static bool IsItemHovered();
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
/* ImGui Wrapper Functions - Menu */
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
static bool BeginMenu(const std::string& label);
|
||||
/* ImGui Wrapper Functions - Menu */
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
static bool BeginMenu(const std::string& label);
|
||||
static bool BeginMenu(const std::string& label, const char* icon);
|
||||
static void EndMenu();
|
||||
static void BeginTooltip();
|
||||
|
@ -164,8 +164,8 @@ namespace SHADE
|
|||
/// </summary>
|
||||
/// <param name="title">Text to display.</param>
|
||||
/// <returns>True if button was pressed.</returns>
|
||||
static bool Button(const std::string& title);
|
||||
static bool Selectable(const std::string& label);
|
||||
static bool Button(const std::string& title);
|
||||
static bool Selectable(const std::string& label);
|
||||
static bool Selectable(const std::string& label, const char* icon);
|
||||
/// <summary>
|
||||
/// Creates a checkbox widget for boolean input.
|
||||
|
|
Loading…
Reference in New Issue