summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2023-12-21 17:44:03 -0500
committerJonathan Bradley <jcb@pikum.xyz>2023-12-23 11:42:23 -0500
commitfa7fc343a0e444da72938fad58d219cf52228976 (patch)
tree24630be0c54f9768a13f32c5970558768e343543 /src/window.cpp
parent6fa3b137c74536d2bab77f3309ca5b4c60953fe0 (diff)
plugin checkpoint - multiple plugins and collision callbacks
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/window.cpp b/src/window.cpp
index f9b6ff2..e7d4506 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2428,13 +2428,23 @@ void RecordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t imageIndex) {
vkCmdDraw(commandBuffer, 3, 1, 0, 0);
// ImGui
- if (pkePlugin.OnImGuiRender) {
+ const auto count = LoadedPkePlugins.Count();
+ bool any = false;
+ for (long i = 0; i < count; ++i) {
+ if (LoadedPkePlugins[i].OnImGuiRender != nullptr) {
+ any = true;
+ break;
+ }
+ }
+ if (any) {
ImGui_ImplVulkan_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
-
- pkePlugin.OnImGuiRender();
-
+ for (long i = 0; i < count; ++i) {
+ if (LoadedPkePlugins[i].OnImGuiRender != nullptr) {
+ LoadedPkePlugins[i].OnImGuiRender();
+ }
+ }
ImGui::Render();
auto drawData = ImGui::GetDrawData();
const bool isMinimized = drawData->DisplaySize.x <= 0.0f || drawData->DisplaySize.y <= 0.0f;