From 331a565cc98b95f49b1e56e7bc5f6a9fe7149dc9 Mon Sep 17 00:00:00 2001 From: Bram Verhulst Date: Mon, 22 Jun 2026 03:22:13 +0200 Subject: [PATCH] Add imgui --- .gitmodules | 3 + destrum/CMakeLists.txt | 2 + destrum/include/destrum/App.h | 3 + destrum/include/destrum/Graphics/GfxDevice.h | 16 ++ .../destrum/Graphics/Pipelines/ImguiPass.h | 55 ++++ destrum/include/destrum/Graphics/Swapchain.h | 5 + destrum/src/App.cpp | 44 +++- destrum/src/Graphics/GfxDevice.cpp | 18 ++ destrum/src/Graphics/Pipelines/ImguiPass.cpp | 240 ++++++++++++++++++ destrum/src/Graphics/Swapchain.cpp | 4 +- destrum/third_party/CMakeLists.txt | 29 +++ destrum/third_party/imgui | 1 + lightkeeper/src/Lightkeeper.cpp | 4 +- lightkeeper/src/main.cpp | 6 +- 14 files changed, 415 insertions(+), 15 deletions(-) create mode 100644 destrum/include/destrum/Graphics/Pipelines/ImguiPass.h create mode 100644 destrum/src/Graphics/Pipelines/ImguiPass.cpp create mode 160000 destrum/third_party/imgui diff --git a/.gitmodules b/.gitmodules index 9bddb95..50c1e3e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -41,3 +41,6 @@ [submodule "destrum/third_party/assimp"] path = destrum/third_party/assimp url = https://github.com/assimp/assimp.git +[submodule "destrum/third_party/imgui"] + path = destrum/third_party/imgui + url = https://github.com/ocornut/imgui.git diff --git a/destrum/CMakeLists.txt b/destrum/CMakeLists.txt index 954e0ad..74548d3 100644 --- a/destrum/CMakeLists.txt +++ b/destrum/CMakeLists.txt @@ -33,6 +33,7 @@ set(SRC_FILES "src/Graphics/Pipelines/MeshPipeline.cpp" "src/Graphics/Pipelines/SkyboxPipeline.cpp" "src/Graphics/Pipelines/SkinningPipeline.cpp" + "src/Graphics/Pipelines/ImguiPass.cpp" "src/Input/InputManager.cpp" @@ -76,6 +77,7 @@ target_link_libraries(destrum stb::image tinygltf assimp + imgui PRIVATE freetype::freetype diff --git a/destrum/include/destrum/App.h b/destrum/include/destrum/App.h index 4e4f843..27e1abc 100644 --- a/destrum/include/destrum/App.h +++ b/destrum/include/destrum/App.h @@ -9,6 +9,8 @@ #include #include +#include + #include @@ -40,6 +42,7 @@ protected: AppParams m_params{}; GfxDevice gfxDevice; + ImguiPass imguiPass; Camera camera{glm::vec3(0.f, 0.f, -5.f), glm::vec3(0, 1, 0)}; diff --git a/destrum/include/destrum/Graphics/GfxDevice.h b/destrum/include/destrum/Graphics/GfxDevice.h index 852efa3..bbdedba 100644 --- a/destrum/include/destrum/Graphics/GfxDevice.h +++ b/destrum/include/destrum/Graphics/GfxDevice.h @@ -27,6 +27,8 @@ #include "Util.h" class MeshCache; +class ImguiPass; + namespace { using ImmediateExecuteFunction = std::function; @@ -54,6 +56,7 @@ public: struct EndFrameProps { const VkClearColorValue clearColor{{0.f, 0.f, 0.f, 1.f}}; glm::ivec4 drawImageBlitRect{}; // where to blit draw image to + ImguiPass* imguiPass = nullptr; }; void endFrame(VkCommandBuffer cmd, const GPUImage& drawImage, const EndFrameProps& props); @@ -110,6 +113,19 @@ public: [[nodiscard]] ImageID getWhiteTextureID() const { return whiteImageId; } + VkInstance getVkInstance() const { return instance; } + VkPhysicalDevice getVkPhysicalDevice() const { return physicalDevice; } + VkDevice getVkDevice() const { return device; } + + std::uint32_t getGraphicsQueueFamily() const { return graphicsQueueFamily; } + VkQueue getGraphicsQueue() const { return graphicsQueue; } + + VkFormat getSwapchainFormat() const { return swapchainFormat; } + std::uint32_t getSwapchainImageCount() const { return swapchain.getImageCount(); } + VkImageView getSwapchainImageView(std::uint32_t imageIndex) const { + return swapchain.getImageView(imageIndex); + } + private: vkb::Instance instance; vkb::PhysicalDevice physicalDevice; diff --git a/destrum/include/destrum/Graphics/Pipelines/ImguiPass.h b/destrum/include/destrum/Graphics/Pipelines/ImguiPass.h new file mode 100644 index 0000000..eae935d --- /dev/null +++ b/destrum/include/destrum/Graphics/Pipelines/ImguiPass.h @@ -0,0 +1,55 @@ +#ifndef DESTRUM_IMGUI_PASS_H +#define DESTRUM_IMGUI_PASS_H + +#include +#include + +class GfxDevice; + +class ImguiPass { +public: + ImguiPass() = default; + ImguiPass(const ImguiPass&) = delete; + ImguiPass& operator=(const ImguiPass&) = delete; + + void init(SDL_Window* window, GfxDevice& gfxDevice); + void handleEvent(const SDL_Event& event); + + void beginFrame(); + void endFrame(); + + void render( + VkCommandBuffer cmd, + VkImage targetImage, + VkImageView targetImageView, + VkImageLayout& targetImageLayout, + VkExtent2D targetExtent + ); + + void onSwapchainRecreated(); + void cleanup(); + + [[nodiscard]] bool isInitialized() const { return initialized; } + [[nodiscard]] bool wantsMouse() const; + [[nodiscard]] bool wantsKeyboard() const; + +private: + void transitionToColorAttachment( + VkCommandBuffer cmd, + VkImage image, + VkImageLayout oldLayout, + VkImageLayout newLayout + ) const; + +private: + GfxDevice* gfx = nullptr; + SDL_Window* sdlWindow = nullptr; + + VkDescriptorPool descriptorPool = VK_NULL_HANDLE; + VkFormat colorFormat = VK_FORMAT_UNDEFINED; + + bool initialized = false; + bool frameBegun = false; +}; + +#endif // DESTRUM_IMGUI_PASS_H diff --git a/destrum/include/destrum/Graphics/Swapchain.h b/destrum/include/destrum/Graphics/Swapchain.h index 55b8dd4..efbf796 100644 --- a/destrum/include/destrum/Graphics/Swapchain.h +++ b/destrum/include/destrum/Graphics/Swapchain.h @@ -35,6 +35,11 @@ public: [[nodiscard]] VkImageView getImageView(int index) const { return imageViews[index]; } + + VkImageView getImageView(std::uint32_t imageIndex) const { + return imageViews.at(imageIndex); + } + private: struct FrameData { VkSemaphore swapchainSemaphore; diff --git a/destrum/src/App.cpp b/destrum/src/App.cpp index e895608..4653943 100644 --- a/destrum/src/App.cpp +++ b/destrum/src/App.cpp @@ -6,12 +6,14 @@ #include #include +#include "imgui.h" #include "glm/gtx/transform.hpp" #include "spdlog/spdlog.h" -App::App() {} +App::App() { +} -void App::init(const AppParams& params) { +void App::init(const AppParams ¶ms) { m_params = params; AssetFS::GetInstance().Init(params.exeDir); @@ -35,6 +37,8 @@ void App::init(const AppParams& params) { } gfxDevice.init(window, params.appName, false); + imguiPass.init(window, gfxDevice); + InputManager::GetInstance().Init(); Time::GetInstance().Update(); @@ -46,7 +50,7 @@ void App::run() { Time::GetInstance().Update(); // initialize delta timing const float fixedDt = static_cast(Time::GetInstance().FixedDeltaTime()); - const int maxSteps = 5; // prevent spiral of death + const int maxSteps = 5; // prevent spiral of death float accumulator = 0.0f; isRunning = true; @@ -68,9 +72,9 @@ void App::run() { camera.Update(dt); - SDL_Event event; while (SDL_PollEvent(&event)) { + imguiPass.handleEvent(event); if (event.type == SDL_QUIT) { isRunning = false; break; @@ -78,22 +82,44 @@ void App::run() { if (event.type == SDL_WINDOWEVENT) { switch (event.window.event) { case SDL_WINDOWEVENT_SIZE_CHANGED: - case SDL_WINDOWEVENT_RESIZED: - { + case SDL_WINDOWEVENT_RESIZED: { resizePending = true; lastResizeTime = std::chrono::steady_clock::now(); break; } } } - if (InputManager::GetInstance().ProcessEvent(event)) { - isRunning = false; + const bool mouseEvent = + event.type == SDL_MOUSEBUTTONDOWN || + event.type == SDL_MOUSEBUTTONUP || + event.type == SDL_MOUSEMOTION || + event.type == SDL_MOUSEWHEEL; + + const bool keyboardEvent = + event.type == SDL_KEYDOWN || + event.type == SDL_KEYUP || + event.type == SDL_TEXTINPUT; + + const bool capturedByImgui = + (mouseEvent && imguiPass.wantsMouse()) || + (keyboardEvent && imguiPass.wantsKeyboard()); + + if (!capturedByImgui) { + if (InputManager::GetInstance().ProcessEvent(event)) { + isRunning = false; + } } } if (!isRunning) break; + imguiPass.beginFrame(); customUpdate(dt); + ImGui::Begin("Debug"); + ImGui::Text("FPS: %.2f", avgFPS); + ImGui::End(); + + imguiPass.endFrame(); int steps = 0; while (accumulator >= fixedDt && steps < maxSteps) { // physics.Update(fixedDt); @@ -116,7 +142,7 @@ void App::run() { if (resizePending && now - lastResizeTime < std::chrono::milliseconds(100)) { continue; - } + } int w = 0; int h = 0; diff --git a/destrum/src/Graphics/GfxDevice.cpp b/destrum/src/Graphics/GfxDevice.cpp index 1f29409..84ef7f2 100644 --- a/destrum/src/Graphics/GfxDevice.cpp +++ b/destrum/src/Graphics/GfxDevice.cpp @@ -13,6 +13,8 @@ #include #include +#include + #include "destrum/Graphics/imageLoader.h" #include "destrum/Util/GameState.h" @@ -77,6 +79,8 @@ void GfxDevice::init(SDL_Window* window, const std::string& appName, bool vSync) .value(); device = vkb::DeviceBuilder{physicalDevice}.build().value(); + volkLoadDevice(device); + graphicsQueueFamily = device.get_queue_index(vkb::QueueType::graphics).value(); graphicsQueue = device.get_queue(vkb::QueueType::graphics).value(); @@ -234,6 +238,20 @@ void GfxDevice::endFrame(VkCommandBuffer cmd, const GPUImage& drawImage, const E } } + // prepare for present + // vkutil::transitionImage(cmd, swapchainImage, swapchainLayout, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR); + // swapchainLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + + if (props.imguiPass) { + props.imguiPass->render( + cmd, + swapchainImage, + getSwapchainImageView(static_cast(swapchainImageIndex)), + swapchainLayout, + getSwapchainExtent() + ); + } + // prepare for present vkutil::transitionImage(cmd, swapchainImage, swapchainLayout, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR); swapchainLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; diff --git a/destrum/src/Graphics/Pipelines/ImguiPass.cpp b/destrum/src/Graphics/Pipelines/ImguiPass.cpp new file mode 100644 index 0000000..946b80e --- /dev/null +++ b/destrum/src/Graphics/Pipelines/ImguiPass.cpp @@ -0,0 +1,240 @@ +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +void ImguiPass::init(SDL_Window* window, GfxDevice& gfxDevice) { + if (initialized) { + return; + } + + gfx = &gfxDevice; + sdlWindow = window; + colorFormat = gfx->getSwapchainFormat(); + + IMGUI_CHECKVERSION(); + ImGui::CreateContext(); + + ImGuiIO& io = ImGui::GetIO(); + io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; + io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; + + ImGui::StyleColorsDark(); + + if (!ImGui_ImplSDL2_InitForVulkan(sdlWindow)) { + throw std::runtime_error("ImGui_ImplSDL2_InitForVulkan failed"); + } + + const std::array poolSizes{{ + { VK_DESCRIPTOR_TYPE_SAMPLER, 1000 }, + { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1000 }, + { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1000 }, + { VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1000 }, + { VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1000 }, + { VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, 1000 }, + { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1000 }, + { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1000 }, + { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, 1000 }, + { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, 1000 }, + { VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, 1000 }, + }}; + + VkDescriptorPoolCreateInfo poolInfo{}; + poolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; + poolInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT; + poolInfo.maxSets = 1000; + poolInfo.poolSizeCount = static_cast(poolSizes.size()); + poolInfo.pPoolSizes = poolSizes.data(); + + VK_CHECK(vkCreateDescriptorPool(gfx->getVkDevice(), &poolInfo, nullptr, &descriptorPool)); + + VkPipelineRenderingCreateInfoKHR pipelineRenderingInfo{}; + pipelineRenderingInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR; + pipelineRenderingInfo.colorAttachmentCount = 1; + pipelineRenderingInfo.pColorAttachmentFormats = &colorFormat; + pipelineRenderingInfo.depthAttachmentFormat = VK_FORMAT_UNDEFINED; + pipelineRenderingInfo.stencilAttachmentFormat = VK_FORMAT_UNDEFINED; + + ImGui_ImplVulkan_PipelineInfo pipelineInfo{}; + pipelineInfo.MSAASamples = VK_SAMPLE_COUNT_1_BIT; + pipelineInfo.PipelineRenderingCreateInfo = pipelineRenderingInfo; + + ImGui_ImplVulkan_InitInfo initInfo{}; + initInfo.ApiVersion = VK_API_VERSION_1_3; + initInfo.Instance = gfxDevice.getVkInstance(); + initInfo.PhysicalDevice = gfxDevice.getVkPhysicalDevice(); + initInfo.Device = gfxDevice.getDevice(); + initInfo.Queue = gfxDevice.getGraphicsQueue(); + initInfo.DescriptorPool = descriptorPool; + initInfo.MinImageCount = 3; + initInfo.ImageCount = 3; + initInfo.UseDynamicRendering = true; + initInfo.PipelineInfoMain = pipelineInfo; + + if (!ImGui_ImplVulkan_Init(&initInfo)) { + throw std::runtime_error("ImGui_ImplVulkan_Init failed"); + } + + initialized = true; +} + +void ImguiPass::handleEvent(const SDL_Event& event) { + if (!initialized) { + return; + } + + ImGui_ImplSDL2_ProcessEvent(&event); +} + +void ImguiPass::beginFrame() { + if (!initialized || frameBegun) { + return; + } + + ImGui_ImplVulkan_NewFrame(); + ImGui_ImplSDL2_NewFrame(); + ImGui::NewFrame(); + + frameBegun = true; +} + +void ImguiPass::endFrame() { + if (!initialized || !frameBegun) { + return; + } + + ImGui::Render(); + + frameBegun = false; +} + +void ImguiPass::render( + VkCommandBuffer cmd, + VkImage targetImage, + VkImageView targetImageView, + VkImageLayout& targetImageLayout, + VkExtent2D targetExtent +) { + if (!initialized) { + return; + } + + ImDrawData* drawData = ImGui::GetDrawData(); + if (drawData == nullptr || drawData->CmdListsCount == 0) { + return; + } + + if (targetImageLayout != VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) { + transitionToColorAttachment( + cmd, + targetImage, + targetImageLayout, + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL + ); + + targetImageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; + } + + VkRenderingAttachmentInfo colorAttachment{}; + colorAttachment.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO; + colorAttachment.imageView = targetImageView; + colorAttachment.imageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; + colorAttachment.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; + colorAttachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE; + + VkRenderingInfo renderingInfo{}; + renderingInfo.sType = VK_STRUCTURE_TYPE_RENDERING_INFO; + renderingInfo.renderArea.offset = { 0, 0 }; + renderingInfo.renderArea.extent = targetExtent; + renderingInfo.layerCount = 1; + renderingInfo.colorAttachmentCount = 1; + renderingInfo.pColorAttachments = &colorAttachment; + + vkCmdBeginRendering(cmd, &renderingInfo); + ImGui_ImplVulkan_RenderDrawData(drawData, cmd); + vkCmdEndRendering(cmd); +} + +void ImguiPass::onSwapchainRecreated() { + if (!initialized) { + return; + } + + ImGui_ImplVulkan_SetMinImageCount(2); +} + +void ImguiPass::cleanup() { + if (!initialized || gfx == nullptr) { + return; + } + + vkDeviceWaitIdle(gfx->getVkDevice()); + + ImGui_ImplVulkan_Shutdown(); + ImGui_ImplSDL2_Shutdown(); + ImGui::DestroyContext(); + + if (descriptorPool != VK_NULL_HANDLE) { + vkDestroyDescriptorPool(gfx->getVkDevice(), descriptorPool, nullptr); + descriptorPool = VK_NULL_HANDLE; + } + + gfx = nullptr; + sdlWindow = nullptr; + colorFormat = VK_FORMAT_UNDEFINED; + initialized = false; + frameBegun = false; +} + +bool ImguiPass::wantsMouse() const { + if (!initialized) { + return false; + } + + return ImGui::GetIO().WantCaptureMouse; +} + +bool ImguiPass::wantsKeyboard() const { + if (!initialized) { + return false; + } + + return ImGui::GetIO().WantCaptureKeyboard; +} + +void ImguiPass::transitionToColorAttachment( + VkCommandBuffer cmd, + VkImage image, + VkImageLayout oldLayout, + VkImageLayout newLayout +) const { + VkImageMemoryBarrier2 imageBarrier{}; + imageBarrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2; + imageBarrier.srcStageMask = VK_PIPELINE_STAGE_2_TRANSFER_BIT | VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT; + imageBarrier.srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT; + imageBarrier.dstStageMask = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT; + imageBarrier.dstAccessMask = VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT; + imageBarrier.oldLayout = oldLayout; + imageBarrier.newLayout = newLayout; + imageBarrier.image = image; + imageBarrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + imageBarrier.subresourceRange.baseMipLevel = 0; + imageBarrier.subresourceRange.levelCount = 1; + imageBarrier.subresourceRange.baseArrayLayer = 0; + imageBarrier.subresourceRange.layerCount = 1; + + VkDependencyInfo dependencyInfo{}; + dependencyInfo.sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO; + dependencyInfo.imageMemoryBarrierCount = 1; + dependencyInfo.pImageMemoryBarriers = &imageBarrier; + + vkCmdPipelineBarrier2(cmd, &dependencyInfo); +} diff --git a/destrum/src/Graphics/Swapchain.cpp b/destrum/src/Graphics/Swapchain.cpp index 19fc22b..d127ddd 100644 --- a/destrum/src/Graphics/Swapchain.cpp +++ b/destrum/src/Graphics/Swapchain.cpp @@ -33,7 +33,7 @@ void Swapchain::createSwapchain(GfxDevice* gfxDevice, VkFormat format, std::uint .format = format, .colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, }) - .add_image_usage_flags(VK_IMAGE_USAGE_TRANSFER_DST_BIT) + .add_image_usage_flags(VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) .set_desired_present_mode( vSync ? VK_PRESENT_MODE_FIFO_KHR : VK_PRESENT_MODE_IMMEDIATE_KHR) .set_desired_extent(width, height) @@ -89,7 +89,7 @@ void Swapchain::recreateSwapchain( .format = format, .colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, }) - .add_image_usage_flags(VK_IMAGE_USAGE_TRANSFER_DST_BIT) + .add_image_usage_flags(VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) .set_desired_present_mode( vSync ? VK_PRESENT_MODE_FIFO_KHR : VK_PRESENT_MODE_IMMEDIATE_KHR) .set_desired_extent(width, height) diff --git a/destrum/third_party/CMakeLists.txt b/destrum/third_party/CMakeLists.txt index 57b9fbb..9abec86 100644 --- a/destrum/third_party/CMakeLists.txt +++ b/destrum/third_party/CMakeLists.txt @@ -65,3 +65,32 @@ set(ASSIMP_INJECT_DEBUG_POSTFIX OFF CACHE BOOL "" FORCE) set(ASSIMP_INSTALL OFF CACHE BOOL "" FORCE) set(ASSIMP_WARNINGS_AS_ERRORS OFF CACHE BOOL "" FORCE) add_subdirectory(assimp) + +set(IMGUI_DIR "${CMAKE_CURRENT_LIST_DIR}/imgui") + +add_library(imgui STATIC + "${IMGUI_DIR}/imgui.cpp" + "${IMGUI_DIR}/imgui_draw.cpp" + "${IMGUI_DIR}/imgui_tables.cpp" + "${IMGUI_DIR}/imgui_widgets.cpp" + "${IMGUI_DIR}/imgui_demo.cpp" + + # Backends you use: + "${IMGUI_DIR}/backends/imgui_impl_sdl2.cpp" + "${IMGUI_DIR}/backends/imgui_impl_vulkan.cpp" +) + +target_include_directories(imgui PUBLIC + "${IMGUI_DIR}" + "${IMGUI_DIR}/backends" +) + +# Because you use volk with Vulkan +target_compile_definitions(imgui PUBLIC + IMGUI_IMPL_VULKAN_USE_VOLK +) + +target_link_libraries(imgui PUBLIC + SDL2::SDL2 + volk +) \ No newline at end of file diff --git a/destrum/third_party/imgui b/destrum/third_party/imgui new file mode 160000 index 0000000..d15966f --- /dev/null +++ b/destrum/third_party/imgui @@ -0,0 +1 @@ +Subproject commit d15966ff6cb48adacaae2f6d40230b4194d8ea70 diff --git a/lightkeeper/src/Lightkeeper.cpp b/lightkeeper/src/Lightkeeper.cpp index f73a0dd..8eb3f20 100644 --- a/lightkeeper/src/Lightkeeper.cpp +++ b/lightkeeper/src/Lightkeeper.cpp @@ -16,6 +16,7 @@ #include #include +#include "imgui.h" #include "destrum/Util/ModelDocUtils.h" LightKeeper::LightKeeper() : App(), renderer(meshCache, materialCache) { @@ -385,7 +386,8 @@ void LightKeeper::customDraw() { gfxDevice.endFrame( cmd, drawImage, { .clearColor = {{0.f, 0.f, 0.5f, 1.f}}, - .drawImageBlitRect = glm::ivec4{} + .drawImageBlitRect = glm::ivec4{}, + .imguiPass = &imguiPass, }); } diff --git a/lightkeeper/src/main.cpp b/lightkeeper/src/main.cpp index 1a4b83e..65143d0 100644 --- a/lightkeeper/src/main.cpp +++ b/lightkeeper/src/main.cpp @@ -16,9 +16,9 @@ int main(int argc, char* argv[]) { LightKeeper app; app.init({ - .windowSize = {800, 600}, - .renderSize = {800, 600}, - .appName = "Astro Engine", + .windowSize = {1200, 800}, + .renderSize = {1200, 800}, + .appName = "Destrum Engine", .windowTitle = "Lightkeeper", .exeDir = exeDir, });