Index: vulkan-game.cpp
===================================================================
--- vulkan-game.cpp	(revision 1cb64e6d2b6196f60400c2e21cc3d1a265874635)
+++ vulkan-game.cpp	(revision ea2b4dc7fae4c4944444ba237db611ed177ca173)
@@ -8,5 +8,4 @@
 
 #include "IMGUI/imgui_impl_sdl.h"
-#include "IMGUI/imgui_impl_vulkan.h"
 
 #include "logger.hpp"
@@ -945,5 +944,29 @@
          sdlOverlayImage, graphicsQueue);
 
-      renderFrame();
+      updateScene();
+
+      ImGui_ImplVulkan_NewFrame();
+      ImGui_ImplSDL2_NewFrame(this->window);
+      ImGui::NewFrame();
+
+      {
+         ImGui::SetNextWindowSize(ImVec2(250, 35), ImGuiCond_Once);
+         ImGui::SetNextWindowPos(ImVec2(380, 10), ImGuiCond_Once);
+         ImGui::Begin("WndMenubar", NULL,
+            ImGuiWindowFlags_NoTitleBar |
+            ImGuiWindowFlags_NoResize |
+            ImGuiWindowFlags_NoMove);
+         ImGui::InvisibleButton("", ImVec2(155, 18));
+         ImGui::SameLine();
+         if (ImGui::Button("Main Menu")) {
+            cout << "Clicked on the main button" << endl;
+            //events.push(Event::GO_TO_MAIN_MENU);
+         }
+         ImGui::End();
+      }
+
+      ImGui::Render();
+
+      renderFrame(ImGui::GetDrawData());
       presentFrame();
    }
@@ -1687,5 +1710,5 @@
 }
 
-void VulkanGame::renderFrame() {
+void VulkanGame::renderFrame(ImDrawData* draw_data) {
    VkResult result = vkAcquireNextImageKHR(device, swapChain, numeric_limits<uint64_t>::max(),
       imageAcquiredSemaphores[currentFrame], VK_NULL_HANDLE, &imageIndex);
@@ -1704,6 +1727,4 @@
       throw runtime_error("failed to reset fence!");
    }
-
-   updateScene();
 
    VKUTIL_CHECK_RESULT(vkResetCommandPool(device, commandPools[imageIndex], 0),
@@ -1737,30 +1758,5 @@
    currentScreen->createRenderCommands(commandBuffers[imageIndex], imageIndex);
 
-   /**********************************************************/
-
-   ImGui_ImplVulkan_NewFrame();
-   ImGui_ImplSDL2_NewFrame(this->window);
-   ImGui::NewFrame();
-
-   {
-      ImGui::SetNextWindowSize(ImVec2(250, 35), ImGuiCond_Once);
-      ImGui::SetNextWindowPos(ImVec2(380, 10), ImGuiCond_Once);
-      ImGui::Begin("WndMenubar", NULL,
-         ImGuiWindowFlags_NoTitleBar |
-         ImGuiWindowFlags_NoResize |
-         ImGuiWindowFlags_NoMove);
-      ImGui::InvisibleButton("", ImVec2(155, 18));
-      ImGui::SameLine();
-      if (ImGui::Button("Main Menu")) {
-         cout << "Clicked on the main button" << endl;
-         //events.push(Event::GO_TO_MAIN_MENU);
-      }
-      ImGui::End();
-   }
-
-   ImGui::Render();
-   ImGui_ImplVulkan_RenderDrawData(ImGui::GetDrawData(), commandBuffers[imageIndex]);
-
-   /**********************************************************/
+   ImGui_ImplVulkan_RenderDrawData(draw_data, commandBuffers[imageIndex]);
 
    vkCmdEndRenderPass(commandBuffers[imageIndex]);
Index: vulkan-game.hpp
===================================================================
--- vulkan-game.hpp	(revision 1cb64e6d2b6196f60400c2e21cc3d1a265874635)
+++ vulkan-game.hpp	(revision ea2b4dc7fae4c4944444ba237db611ed177ca173)
@@ -17,4 +17,6 @@
 #include <SDL2/SDL.h>
 #include <SDL2/SDL_ttf.h>
+
+#include "IMGUI/imgui_impl_vulkan.h"
 
 #include "consts.hpp"
@@ -451,5 +453,5 @@
             vector<VkDescriptorBufferInfo>& bufferInfoList);
 
-      void renderFrame();
+      void renderFrame(ImDrawData* draw_data);
       void presentFrame();
 
