From 53744f1de092e0aea8da3eb959a2c93cfcd62694 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 10 Nov 2025 18:19:16 -0500 Subject: [PATCH] xo-imgui: refactor: method names in MinimalImGuiVulkan --- xo-imgui/example/ex4a/VulkanApp.cpp | 8 +++---- xo-imgui/example/ex4a/VulkanApp.hpp | 36 ++++++++++++++--------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/xo-imgui/example/ex4a/VulkanApp.cpp b/xo-imgui/example/ex4a/VulkanApp.cpp index 17056b00..bffe57cc 100644 --- a/xo-imgui/example/ex4a/VulkanApp.cpp +++ b/xo-imgui/example/ex4a/VulkanApp.cpp @@ -4,10 +4,10 @@ void MinimalImGuiVulkan::run() { - this->initWindow(); - this->initVulkan(); - this->initImGui(); - this->mainLoop(); + this->init_window(); + this->init_vulkan(); + this->init_imgui(); + this->main_loop(); this->cleanup(); } diff --git a/xo-imgui/example/ex4a/VulkanApp.hpp b/xo-imgui/example/ex4a/VulkanApp.hpp index 5ee5c098..4458b84d 100644 --- a/xo-imgui/example/ex4a/VulkanApp.hpp +++ b/xo-imgui/example/ex4a/VulkanApp.hpp @@ -18,22 +18,7 @@ public: void run(); private: - void initVulkan() { - createInstance(); - createSurface(); - pickPhysicalDevice(); - createLogicalDevice(); - this->createSwapchain(); - this->createImageViews(); - this->createRenderPass(); // must come before createFrameBuffers - this->createFramebuffers(); - createCommandPool(); - createCommandBuffers(); - createSyncObjects(); - createDescriptorPool(); - } - - void initWindow() { + void init_window() { if (SDL_Init(SDL_INIT_VIDEO) != 0) { throw std::runtime_error("Failed to initialize SDL!"); } @@ -51,6 +36,21 @@ private: } } + void init_vulkan() { + createInstance(); + createSurface(); + pickPhysicalDevice(); + createLogicalDevice(); + this->createSwapchain(); + this->createImageViews(); + this->createRenderPass(); // must come before createFrameBuffers + this->createFramebuffers(); + createCommandPool(); + createCommandBuffers(); + createSyncObjects(); + createDescriptorPool(); + } + void createInstance() { VkApplicationInfo appInfo{}; appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; @@ -365,7 +365,7 @@ private: } } - void initImGui() { + void init_imgui() { // Setup Dear ImGui context IMGUI_CHECKVERSION(); ImGui::CreateContext(); @@ -435,7 +435,7 @@ private: vkFreeCommandBuffers(device, commandPool, 1, &commandBuffer); } - void mainLoop() { + void main_loop() { SDL_Event event; while (!quit) {