Added imgui

This commit is contained in:
Alexandre 2026-07-14 15:43:10 +02:00
parent d5d8dc50e4
commit bf2e15fcd3

View File

@ -85,11 +85,7 @@ class Engine {
void run();
void immediateSubmit(
std::function <
void(
VkCommandBuffer cmd
)
> && function
std::function <void(VkCommandBuffer cmd)>&& function
);
private:
@ -347,7 +343,7 @@ void Engine::draw() {
vkutil::transitionImage(
cmd,
_swapchainImages[swapchainImageIndex],
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
);
@ -417,8 +413,6 @@ void Engine::run() {
void Engine::initRender() {
initVulkan();
initSwapchain();
//initDefaultRenderpass();
//initFramebuffers();
initCommands();
initSyncStructures();
initDescriptors();
@ -854,6 +848,9 @@ void Engine::initBackgroundPipelines() {
}
void Engine::initImgui() {
#ifdef DEBUG
fmt::println("[Engine:Init] Initializing ImGui...");
#endif
// Oversized descriptor pool for IMGUI, from the official tutorial
// Ajust for optimization, or needs
@ -910,7 +907,7 @@ void Engine::initImgui() {
.PipelineRenderingCreateInfo {
.sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR,
.colorAttachmentCount = 1,
.pColorAttachmentFormats = &_drawImage.imageFormat
.pColorAttachmentFormats = &_swapchainImageFormat
}
},
.UseDynamicRendering = true
@ -926,7 +923,9 @@ void Engine::initImgui() {
nullptr
);
});
#ifdef DEBUG
fmt::println("[Engine:Init] ImGui initialized !");
#endif
}
@ -1055,6 +1054,7 @@ void Engine::drawImgui(
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
)
};
VkRenderingInfo renderInfo {
vkinit::renderingInfo(
_swapchainExtent,
@ -1077,9 +1077,7 @@ void Engine::drawImgui(
}
void Engine::immediateSubmit(
std::function<
void(VkCommandBuffer cmd)
>&& function
std::function<void(VkCommandBuffer cmd)>&& function
) {
VK_CHECK(
@ -1139,7 +1137,8 @@ void Engine::immediateSubmit(
1,
&_immFence,
true,
INT64_MAX
9999999999
//INT64_MAX
);
);