From 6e498a3781f5ccbbaa6cf5e407cf67722624760f Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 30 Nov 2023 11:31:45 -0500 Subject: prefer explicit callback system over events --- src/window.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/window.cpp') diff --git a/src/window.cpp b/src/window.cpp index 2b75cdd..8d40221 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2427,12 +2427,12 @@ void RecordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t imageIndex) { vkCmdDraw(commandBuffer, 3, 1, 0, 0); // ImGui - if (isImGuiRenderActive) { + if (isImGuiRenderActive && pkeGameCallbacks.OnImGuiRender) { ImGui_ImplVulkan_NewFrame(); ImGui_ImplGlfw_NewFrame(); ImGui::NewFrame(); - Event_Dispatch("RenderImGui"); + pkeGameCallbacks.OnImGuiRender(); ImGui::Render(); auto drawData = ImGui::GetDrawData(); @@ -2547,7 +2547,7 @@ void FramebufferResizeCallback(GLFWwindow *window, int width, int height) { shouldRecreateSwapchain = true; } -void CreateWindow(PKEWindowProperties *wp) { +void CreateWindow(PKEWindowProperties wp) { if (vkInstance != nullptr) return; MemBkt_Vulkan = Pke_BeginTransientBucket(); vulkanAllocs = Pke_New>(MemBkt_Vulkan); @@ -2555,7 +2555,7 @@ void CreateWindow(PKEWindowProperties *wp) { vulkanAllocs->Reserve(2048); glfwInit(); glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); - window = glfwCreateWindow(wp->width, wp->height, "Pikul", nullptr, nullptr); + window = glfwCreateWindow(wp.width, wp.height, "Pikul", nullptr, nullptr); InitVulkan(); glfwSetFramebufferSizeCallback(window, FramebufferResizeCallback); CreateSwapchain(); -- cgit v1.2.3