diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-11-30 11:31:45 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-11-30 11:31:45 -0500 |
| commit | 6e498a3781f5ccbbaa6cf5e407cf67722624760f (patch) | |
| tree | 8a4e95e4d962b3102d8d348a0f292f8ef8ee30df /src/window.cpp | |
| parent | 9830bc2425385de6e666251fa9df6318605c639c (diff) | |
prefer explicit callback system over events
Diffstat (limited to 'src/window.cpp')
| -rw-r--r-- | src/window.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<EventHandler>("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<DynArray<pke_vkAllocData>>(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(); |
