Index: vulkan-game.cpp
===================================================================
--- vulkan-game.cpp	(revision b8d44568940bc98534979cd1d608d923cca03276)
+++ vulkan-game.cpp	(revision 4e705d63b9aa0c0a2a6029899904ebf814b6f543)
@@ -42,7 +42,25 @@
    cout << "Vulkan Game" << endl;
 
-   // This gets the runtime version, use SDL_VERSION() for the comppile-time version
+   if (initUI(width, height, guiFlags) == RTWO_ERROR) {
+      return;
+   }
+
+   initVulkan();
+   mainLoop();
+   cleanup();
+
+   close_log();
+}
+
+bool VulkanGame::initUI(int width, int height, unsigned char guiFlags) {
    // TODO: Create a game-gui function to get the gui version and retrieve it that way
-   SDL_GetVersion(&sdlVersion);
+
+   SDL_VERSION(&sdlVersion); // This gets the compile-time version
+   SDL_GetVersion(&sdlVersion); // This gets the runtime version
+
+   cout << "SDL "<<
+      to_string(sdlVersion.major) << "." <<
+      to_string(sdlVersion.minor) << "." <<
+      to_string(sdlVersion.patch) << endl;
 
    // TODO: Refactor the logger api to be more flexible,
@@ -54,4 +72,5 @@
       to_string(sdlVersion.patch).c_str());
 
+   // TODO: Use open_Log() and related functions instead of gl_log ones
    open_log();
    get_log() << "starting SDL" << endl;
@@ -61,18 +80,4 @@
       (int)sdlVersion.patch << endl;
 
-   if (initWindow(width, height, guiFlags) == RTWO_ERROR) {
-      return;
-   }
-
-   initVulkan();
-   mainLoop();
-   cleanup();
-
-   close_log();
-}
-
-// TODO: Make some more init functions, or call this initUI if the
-// amount of things initialized here keeps growing
-bool VulkanGame::initWindow(int width, int height, unsigned char guiFlags) {
    // TODO: Put all fonts, textures, and images in the assets folder
    gui = new GameGui_SDL();
@@ -102,10 +107,17 @@
    }
 
-   SDL_VERSION(&sdlVersion);
-
-   cout << "SDL "<<
-      to_string(sdlVersion.major) << "." <<
-      to_string(sdlVersion.minor) << "." <<
-      to_string(sdlVersion.patch) << endl;
+   uiOverlay = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET,
+      gui->getWindowWidth(), gui->getWindowHeight());
+
+   if (uiOverlay == nullptr) {
+      cout << "Unable to create blank texture! SDL Error: " << SDL_GetError() << endl;
+      return RTWO_ERROR;
+   }
+   if (SDL_SetTextureBlendMode(uiOverlay, SDL_BLENDMODE_BLEND) != 0) {
+      cout << "Unable to set texture blend mode! SDL Error: " << SDL_GetError() << endl;
+      return RTWO_ERROR;
+   }
+
+   SDL_SetRenderTarget(renderer, uiOverlay);
 
    font = TTF_OpenFont("assets/fonts/lazy.ttf", 28);
@@ -145,27 +157,4 @@
 
    SDL_FreeSurface(imageSDLSurface);
-
-   // In SDL 2.0.10 (currently, the latest), SDL_TEXTUREACCESS_TARGET is required to get a transparent overlay working
-   // However, the latest SDL version available through homebrew on Mac is 2.0.9, which requires SDL_TEXTUREACCESS_STREAMING
-   // I tried building sdl 2.0.10 (and sdl_image and sdl_ttf) from source on Mac, but had some issues, so this is easier
-   // until the homebrew recipe is updated
-   if (sdlVersion.major == 2 && sdlVersion.minor == 0 && sdlVersion.patch == 9) {
-      uiOverlay = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING,
-         gui->getWindowWidth(), gui->getWindowHeight());
-   } else {
-      uiOverlay = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET,
-         gui->getWindowWidth(), gui->getWindowHeight());
-   }
-
-   if (uiOverlay == nullptr) {
-      cout << "Unable to create blank texture! SDL Error: " << SDL_GetError() << endl;
-      return RTWO_ERROR;
-   }
-   if (SDL_SetTextureBlendMode(uiOverlay, SDL_BLENDMODE_BLEND) != 0) {
-      cout << "Unable to set texture blend mode! SDL Error: " << SDL_GetError() << endl;
-      return RTWO_ERROR;
-   }
-
-   SDL_SetRenderTarget(renderer, uiOverlay);
 
    return RTWO_SUCCESS;
@@ -755,13 +744,9 @@
                break;
             case UI_EVENT_MOUSEBUTTONDOWN:
-               cout << "Mouse button down event detected" << endl;
-               break;
             case UI_EVENT_MOUSEBUTTONUP:
-               cout << "Mouse button up event detected" << endl;
-               break;
             case UI_EVENT_MOUSEMOTION:
                break;
             case UI_EVENT_UNKNOWN:
-               cout << "Unknown event type: 0x" << hex << e.unknown.eventType << dec << endl;
+               //cout << "Unknown event type: 0x" << hex << e.unknown.eventType << dec << endl;
                break;
             default:
@@ -1030,4 +1015,6 @@
    uint32_t imageIndex;
 
+   // TODO: Recreate the swap chain here if the user went to a new screen
+
    VkResult result = vkAcquireNextImageKHR(device, swapChain, numeric_limits<uint64_t>::max(),
       imageAvailableSemaphores[currentFrame], VK_NULL_HANDLE, &imageIndex);
@@ -1127,21 +1114,21 @@
    // If they do, I don't need to check for that
 
+   if (fontSDLTexture != nullptr) {
+      SDL_DestroyTexture(fontSDLTexture);
+      fontSDLTexture = nullptr;
+   }
+
+   if (imageSDLTexture != nullptr) {
+      SDL_DestroyTexture(imageSDLTexture);
+      imageSDLTexture = nullptr;
+   }
+
+   TTF_CloseFont(font);
+   font = nullptr;
+
    if (uiOverlay != nullptr) {
       SDL_DestroyTexture(uiOverlay);
       uiOverlay = nullptr;
    }
-
-   if (fontSDLTexture != nullptr) {
-      SDL_DestroyTexture(fontSDLTexture);
-      fontSDLTexture = nullptr;
-   }
-
-   if (imageSDLTexture != nullptr) {
-      SDL_DestroyTexture(imageSDLTexture);
-      imageSDLTexture = nullptr;
-   }
-
-   TTF_CloseFont(font);
-   font = nullptr;
 
    SDL_DestroyRenderer(renderer);
Index: vulkan-game.hpp
===================================================================
--- vulkan-game.hpp	(revision b8d44568940bc98534979cd1d608d923cca03276)
+++ vulkan-game.hpp	(revision 4e705d63b9aa0c0a2a6029899904ebf814b6f543)
@@ -11,11 +11,13 @@
 #include <glm/gtc/matrix_transform.hpp>
 
+#include "vulkan-utils.hpp"
+#include "graphics-pipeline_vulkan.hpp"
+
 #include "game-gui-sdl.hpp"
-#include "graphics-pipeline_vulkan.hpp"
-
-#include "vulkan-utils.hpp"
 
 using namespace glm;
 using namespace std::chrono;
+
+// TODO: Switch from union to std::variant
 
 #ifdef NDEBUG
@@ -193,6 +195,19 @@
       void run(int width, int height, unsigned char guiFlags);
 
+      GraphicsPipeline_Vulkan<OverlayVertex, void*> overlayPipeline;
+
+      GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject> modelPipeline;
+
+      GraphicsPipeline_Vulkan<ShipVertex, SSBO_ModelObject> shipPipeline;
+
+      GraphicsPipeline_Vulkan<AsteroidVertex, SSBO_Asteroid> asteroidPipeline;
+
+      GraphicsPipeline_Vulkan<LaserVertex, SSBO_Laser> laserPipeline;
+
+      GraphicsPipeline_Vulkan<ExplosionVertex, SSBO_Explosion> explosionPipeline;
+
    private:
       // TODO: Make these consts static
+      // Also, maybe move them into consts.hpp
 
       const int MAX_FRAMES_IN_FLIGHT;
@@ -207,4 +222,5 @@
       vec3 cam_pos;
 
+      // TODO: Good place to start using smart pointers
       GameGui* gui;
 
@@ -237,20 +253,4 @@
       VulkanImage depthImage;
 
-      VkSampler textureSampler;
-
-      VulkanImage sdlOverlayImage;
-      VkDescriptorImageInfo sdlOverlayImageDescriptor;
-
-      VulkanImage floorTextureImage;
-      VkDescriptorImageInfo floorTextureImageDescriptor;
-
-      VulkanImage laserTextureImage;
-      VkDescriptorImageInfo laserTextureImageDescriptor;
-
-      TTF_Font* font;
-      SDL_Texture* fontSDLTexture;
-
-      SDL_Texture* imageSDLTexture;
-
       vector<VkSemaphore> imageAvailableSemaphores;
       vector<VkSemaphore> renderFinishedSemaphores;
@@ -261,8 +261,21 @@
       bool framebufferResized;
 
+      VkSampler textureSampler;
+
+      VulkanImage sdlOverlayImage;
+      VkDescriptorImageInfo sdlOverlayImageDescriptor;
+
+      VulkanImage floorTextureImage;
+      VkDescriptorImageInfo floorTextureImageDescriptor;
+
+      VulkanImage laserTextureImage;
+      VkDescriptorImageInfo laserTextureImageDescriptor;
+
+      TTF_Font* font;
+      SDL_Texture* fontSDLTexture;
+
+      SDL_Texture* imageSDLTexture;
+
       mat4 viewMat, projMat;
-
-      GraphicsPipeline_Vulkan<OverlayVertex, void*> overlayPipeline;
-      vector<SceneObject<OverlayVertex, void*>> overlayObjects;
 
       // TODO: Maybe make the ubo objects part of the pipeline class since there's only one ubo
@@ -274,5 +287,6 @@
       // if there is a need to add other uniform variables to one or more of the shaders
 
-      GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject> modelPipeline;
+      vector<SceneObject<OverlayVertex, void*>> overlayObjects;
+
       vector<SceneObject<ModelVertex, SSBO_ModelObject>> modelObjects;
 
@@ -283,5 +297,4 @@
       UBO_VP_mats object_VP_mats;
 
-      GraphicsPipeline_Vulkan<ShipVertex, SSBO_ModelObject> shipPipeline;
       vector<SceneObject<ShipVertex, SSBO_ModelObject>> shipObjects;
 
@@ -292,5 +305,4 @@
       UBO_VP_mats ship_VP_mats;
 
-      GraphicsPipeline_Vulkan<AsteroidVertex, SSBO_Asteroid> asteroidPipeline;
       vector<SceneObject<AsteroidVertex, SSBO_Asteroid>> asteroidObjects;
 
@@ -301,5 +313,4 @@
       UBO_VP_mats asteroid_VP_mats;
 
-      GraphicsPipeline_Vulkan<LaserVertex, SSBO_Laser> laserPipeline;
       vector<SceneObject<LaserVertex, SSBO_Laser>> laserObjects;
 
@@ -310,5 +321,4 @@
       UBO_VP_mats laser_VP_mats;
 
-      GraphicsPipeline_Vulkan<ExplosionVertex, SSBO_Explosion> explosionPipeline;
       vector<SceneObject<ExplosionVertex, SSBO_Explosion>> explosionObjects;
 
@@ -336,5 +346,5 @@
       EffectOverTime<AsteroidVertex, SSBO_Asteroid>* rightLaserEffect = nullptr;
 
-      bool initWindow(int width, int height, unsigned char guiFlags);
+      bool initUI(int width, int height, unsigned char guiFlags);
       void initVulkan();
       void initGraphicsPipelines();
