xo-imgui: refactor: method names in MinimalImGuiVulkan

This commit is contained in:
Roland Conybeare 2025-11-10 18:19:16 -05:00
commit 53744f1de0
2 changed files with 22 additions and 22 deletions

View file

@ -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();
}

View file

@ -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) {