Multi-scene editing refactor
This commit is contained in:
@@ -423,7 +423,7 @@ void VkRenderer::InitImgui()
|
||||
io.Fonts->AddFontFromMemoryTTF(StaticResources::Resources_Fonts_Poppins_Regular_ttf, StaticResources::Resources_Fonts_Poppins_Regular_ttf_len, 16.0);
|
||||
|
||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||
//io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
ImGui::StyleColorsDark();
|
||||
|
||||
ImGuiStyle& s = ImGui::GetStyle();
|
||||
@@ -654,6 +654,15 @@ void VkRenderer::EndDraw()
|
||||
|
||||
VK_CALL(vkQueuePresentKHR(GPUQueue, &presentInfo));
|
||||
|
||||
auto& io = ImGui::GetIO();
|
||||
//io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
//Update and Render additional Platform Windows
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
|
||||
{
|
||||
ImGui::UpdatePlatformWindows();
|
||||
ImGui::RenderPlatformWindowsDefault();
|
||||
}
|
||||
|
||||
// Increase the number of frames drawn
|
||||
FrameNumber++;
|
||||
}
|
||||
|
||||
@@ -263,5 +263,17 @@ namespace Nuake
|
||||
{
|
||||
DrawButtonImage(image, image, image, tintNormal, tintHovered, tintPressed, ImGui::GetItemRectMin(), ImGui::GetItemRectMax());
|
||||
};
|
||||
|
||||
bool Splitter(bool split_vertically, float thickness, float* size1, float* size2, float min_size1, float min_size2, float splitter_long_axis_size)
|
||||
{
|
||||
using namespace ImGui;
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
ImGuiID id = window->GetID("##Splitter");
|
||||
ImRect bb;
|
||||
bb.Min = window->DC.CursorPos + (split_vertically ? ImVec2(*size1, 0.0f) : ImVec2(0.0f, *size1));
|
||||
bb.Max = bb.Min + CalcItemSize(split_vertically ? ImVec2(thickness, splitter_long_axis_size) : ImVec2(splitter_long_axis_size, thickness), 0.0f, 0.0f);
|
||||
return SplitterBehavior(bb, id, split_vertically ? ImGuiAxis_X : ImGuiAxis_Y, size1, size2, min_size1, min_size2, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,5 +79,6 @@ namespace Nuake
|
||||
|
||||
ImRect RectOffset(const ImRect& rect, ImVec2 xy);
|
||||
|
||||
bool Splitter(bool split_vertically, float thickness, float* size1, float* size2, float min_size1, float min_size2, float splitter_long_axis_size = -1.0f);
|
||||
}
|
||||
}
|
||||
@@ -258,8 +258,8 @@ void Window::EndDraw()
|
||||
if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
|
||||
{
|
||||
GLFWwindow* backup_current_context = glfwGetCurrentContext();
|
||||
ImGui::UpdatePlatformWindows();
|
||||
ImGui::RenderPlatformWindowsDefault();
|
||||
//ImGui::UpdatePlatformWindows();
|
||||
//ImGui::RenderPlatformWindowsDefault();
|
||||
glfwMakeContextCurrent(backup_current_context);
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ void Window::InitImgui()
|
||||
io.Fonts->AddFontFromMemoryTTF(StaticResources::Resources_Fonts_Poppins_Regular_ttf, StaticResources::Resources_Fonts_Poppins_Regular_ttf_len, 16.0);
|
||||
|
||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||
//io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
ImGui::StyleColorsDark();
|
||||
|
||||
ImGuiStyle& s = ImGui::GetStyle();
|
||||
|
||||
Reference in New Issue
Block a user