Index: game-gui-sdl.cpp
===================================================================
--- game-gui-sdl.cpp	(revision a2f62d7e0b4b68fcc0c54acb1c1200b2bf9af80d)
+++ game-gui-sdl.cpp	(revision c324d6ad769beecddc5c1ae64c4eb7aa438f5879)
@@ -3,4 +3,6 @@
 #include <map>
 #include <queue>
+
+#include <SDL2/SDL_ttf.h>
 
 #include "compiler.hpp"
@@ -9,13 +11,12 @@
 using namespace std;
 
-string GameGui_SDL::s_errorMessage;
-
 GameGui_SDL::GameGui_SDL() : keyState(SDL_GetKeyboardState(NULL)) {
+   window = nullptr;
 }
 
 string& GameGui_SDL::getError() {
-   GameGui_SDL::s_errorMessage = SDL_GetError();
+   s_errorMessage = SDL_GetError();
 
-   return GameGui_SDL::s_errorMessage;
+   return s_errorMessage;
 }
 
@@ -24,5 +25,5 @@
    // prevents SDL from setting up its own handlers for SIG_SEGV and stuff like that
 
-   GameGui_SDL::s_errorMessage = "No error";
+   s_errorMessage = "No error";
 
    if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
@@ -56,12 +57,12 @@
 
 #ifdef WINDOWS
-    uint32_t flags = SDL_WINDOW_VULKAN | SDL_WINDOW_SHOWN | (fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_RESIZABLE);
+   uint32_t flags = SDL_WINDOW_VULKAN | SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI |
+      (fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_RESIZABLE);
 #else
-    uint32_t flags = SDL_WINDOW_VULKAN | SDL_WINDOW_SHOWN | (fullscreen ? SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE);
+   uint32_t flags = SDL_WINDOW_VULKAN | SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI |
+      (fullscreen ? SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE);
 #endif
 
-   window = SDL_CreateWindow(title.c_str(),
-               SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
-               width, height, flags);
+   window = SDL_CreateWindow(title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, flags);
 
    refreshWindowSize();
@@ -148,4 +149,5 @@
 
 void GameGui_SDL::refreshWindowSize() {
+   // TODO: Make sure this works on a mac (the analogous glfw function had issues on Mac retina displays)
    SDL_GetWindowSize(window, &windowWidth, &windowHeight);
 }
Index: game-gui-sdl.hpp
===================================================================
--- game-gui-sdl.hpp	(revision a2f62d7e0b4b68fcc0c54acb1c1200b2bf9af80d)
+++ game-gui-sdl.hpp	(revision c324d6ad769beecddc5c1ae64c4eb7aa438f5879)
@@ -5,5 +5,4 @@
 
 #include <SDL2/SDL.h>
-#include <SDL2/SDL_ttf.h>
 
 #ifdef GAMEGUI_INCLUDE_VULKAN
@@ -41,5 +40,5 @@
       const Uint8* keyState;
 
-      static string s_errorMessage;
+      string s_errorMessage;
 };
 
Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision a2f62d7e0b4b68fcc0c54acb1c1200b2bf9af80d)
+++ new-game.cpp	(revision c324d6ad769beecddc5c1ae64c4eb7aa438f5879)
@@ -8,10 +8,10 @@
 #include <glm/gtc/type_ptr.hpp>
 
+#include <GL/glew.h>
+#include <GLFW/glfw3.h>
+
 #include "IMGUI/imgui.h"
 #include "IMGUI/imgui_impl_glfw.h"
 #include "IMGUI/imgui_impl_opengl3.h"
-
-#include <GL/glew.h>
-#include <GLFW/glfw3.h>
 
 #include <cstdio>
Index: vulkan-game.cpp
===================================================================
--- vulkan-game.cpp	(revision a2f62d7e0b4b68fcc0c54acb1c1200b2bf9af80d)
+++ vulkan-game.cpp	(revision c324d6ad769beecddc5c1ae64c4eb7aa438f5879)
@@ -5,6 +5,6 @@
 #include <numeric>
 #include <set>
-
-#include "consts.hpp"
+#include <stdexcept>
+
 #include "logger.hpp"
 
@@ -16,9 +16,19 @@
 using namespace std;
 
-// TODO: Update all occurances of instance variables to use this->
+// TODO: Update all occurances of instance variables to use this-> (Actually, not sure if I really want to do this)
+
+/* TODO: Try doing the following tasks based on the Vulkan implementation of IMGUI (Also maybe looks at Sascha Willems' code to see how he does these things)
+ *
+ * - When recreating the swapchain, pass the old one in and destroy the old one after the new one is created
+ * - Recreate semaphores when recreating the swapchain
+ *     - imgui uses one image acquired and one render complete sem  and once fence per frame\
+ * - IMGUI creates one command pool per framebuffer
+ */
 
 VulkanGame::VulkanGame(int maxFramesInFlight) : MAX_FRAMES_IN_FLIGHT(maxFramesInFlight) {
    this->gui = nullptr;
    this->window = nullptr;
+
+   this->debugMessenger = VK_NULL_HANDLE;
 
    this->currentFrame = 0;
@@ -85,5 +95,5 @@
 
    // TODO: Refactor the logger api to be more flexible,
-   // esp. since gl_log() and gl_log_err() have issues printing anything besides stirngs
+   // esp. since gl_log() and gl_log_err() have issues printing anything besides strings
    restart_gl_log();
    gl_log("starting SDL\n%s.%s.%s",
@@ -93,4 +103,5 @@
 
    // TODO: Use open_Log() and related functions instead of gl_log ones
+   // TODO: In addition, delete the gl_log functions
    open_log();
    get_log() << "starting SDL" << endl;
@@ -807,4 +818,5 @@
    }
 
+   // TODO: Should probably check the returned result
    vkDeviceWaitIdle(device);
 }
@@ -1131,5 +1143,5 @@
 }
 
-void VulkanGame::createVulkanInstance(const vector<const char*> &validationLayers) {
+void VulkanGame::createVulkanInstance(const vector<const char*>& validationLayers) {
    if (ENABLE_VALIDATION_LAYERS && !VulkanUtils::checkValidationLayerSupport(validationLayers)) {
       throw runtime_error("validation layers requested, but not available!");
@@ -1181,5 +1193,7 @@
 
 void VulkanGame::setupDebugMessenger() {
-   if (!ENABLE_VALIDATION_LAYERS) return;
+   if (!ENABLE_VALIDATION_LAYERS) {
+      return;
+   }
 
    VkDebugUtilsMessengerCreateInfoEXT createInfo;
@@ -1217,4 +1231,5 @@
 void VulkanGame::pickPhysicalDevice(const vector<const char*>& deviceExtensions) {
    uint32_t deviceCount = 0;
+   // TODO: Check VkResult
    vkEnumeratePhysicalDevices(instance, &deviceCount, nullptr);
 
@@ -1224,4 +1239,5 @@
 
    vector<VkPhysicalDevice> devices(deviceCount);
+   // TODO: Check VkResult
    vkEnumeratePhysicalDevices(instance, &deviceCount, devices.data());
 
@@ -1262,6 +1278,6 @@
 }
 
-void VulkanGame::createLogicalDevice(
-      const vector<const char*> validationLayers, const vector<const char*>& deviceExtensions) {
+void VulkanGame::createLogicalDevice(const vector<const char*>& validationLayers,
+      const vector<const char*>& deviceExtensions) {
    QueueFamilyIndices indices = VulkanUtils::findQueueFamilies(physicalDevice, surface);
 
@@ -1285,4 +1301,5 @@
    VkDeviceCreateInfo createInfo = {};
    createInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
+
    createInfo.queueCreateInfoCount = static_cast<uint32_t>(queueCreateInfoList.size());
    createInfo.pQueueCreateInfos = queueCreateInfoList.data();
@@ -1317,7 +1334,7 @@
    VkExtent2D extent = VulkanUtils::chooseSwapExtent(swapChainSupport.capabilities, gui->getWindowWidth(), gui->getWindowHeight());
 
-   uint32_t imageCount = swapChainSupport.capabilities.minImageCount + 1;
-   if (swapChainSupport.capabilities.maxImageCount > 0 && imageCount > swapChainSupport.capabilities.maxImageCount) {
-      imageCount = swapChainSupport.capabilities.maxImageCount;
+   swapChainImageCount = swapChainSupport.capabilities.minImageCount + 1;
+   if (swapChainSupport.capabilities.maxImageCount > 0 && swapChainImageCount > swapChainSupport.capabilities.maxImageCount) {
+      swapChainImageCount = swapChainSupport.capabilities.maxImageCount;
    }
 
@@ -1325,5 +1342,5 @@
    createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
    createInfo.surface = surface;
-   createInfo.minImageCount = imageCount;
+   createInfo.minImageCount = swapChainImageCount;
    createInfo.imageFormat = surfaceFormat.format;
    createInfo.imageColorSpace = surfaceFormat.colorSpace;
@@ -1355,7 +1372,7 @@
    }
 
-   vkGetSwapchainImagesKHR(device, swapChain, &imageCount, nullptr);
-   swapChainImages.resize(imageCount);
-   vkGetSwapchainImagesKHR(device, swapChain, &imageCount, swapChainImages.data());
+   vkGetSwapchainImagesKHR(device, swapChain, &swapChainImageCount, nullptr);
+   swapChainImages.resize(swapChainImageCount);
+   vkGetSwapchainImagesKHR(device, swapChain, &swapChainImageCount, swapChainImages.data());
 
    swapChainImageFormat = surfaceFormat.format;
Index: vulkan-game.hpp
===================================================================
--- vulkan-game.hpp	(revision a2f62d7e0b4b68fcc0c54acb1c1200b2bf9af80d)
+++ vulkan-game.hpp	(revision c324d6ad769beecddc5c1ae64c4eb7aa438f5879)
@@ -15,4 +15,5 @@
 #include <vulkan/vulkan.h>
 
+#include <SDL2/SDL.h>
 #include <SDL2/SDL_ttf.h>
 
@@ -227,4 +228,10 @@
 
    private:
+      static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(
+         VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
+         VkDebugUtilsMessageTypeFlagsEXT messageType,
+         const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
+         void* pUserData);
+
       // TODO: Make these consts static
       // Also, maybe move them into consts.hpp
@@ -261,4 +268,5 @@
       VkQueue presentQueue;
 
+      uint32_t swapChainImageCount;
       VkSwapchainKHR swapChain;
       vector<VkImage> swapChainImages;
@@ -374,5 +382,5 @@
       void cleanup();
 
-      void createVulkanInstance(const vector<const char*> &validationLayers);
+      void createVulkanInstance(const vector<const char*>& validationLayers);
       void setupDebugMessenger();
       void populateDebugMessengerCreateInfo(VkDebugUtilsMessengerCreateInfoEXT& createInfo);
@@ -380,6 +388,5 @@
       void pickPhysicalDevice(const vector<const char*>& deviceExtensions);
       bool isDeviceSuitable(VkPhysicalDevice physicalDevice, const vector<const char*>& deviceExtensions);
-      void createLogicalDevice(
-         const vector<const char*> validationLayers,
+      void createLogicalDevice(const vector<const char*>& validationLayers,
          const vector<const char*>& deviceExtensions);
       void createSwapChain();
@@ -436,10 +443,4 @@
 
       void cleanupSwapChain();
-
-      static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(
-            VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
-            VkDebugUtilsMessageTypeFlagsEXT messageType,
-            const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
-            void* pUserData);
 };
 
Index: vulkan-utils.cpp
===================================================================
--- vulkan-utils.cpp	(revision a2f62d7e0b4b68fcc0c54acb1c1200b2bf9af80d)
+++ vulkan-utils.cpp	(revision c324d6ad769beecddc5c1ae64c4eb7aa438f5879)
@@ -145,9 +145,23 @@
    VkPresentModeKHR bestMode = VK_PRESENT_MODE_FIFO_KHR;
 
+   /* This functions effectively selects present modes in this order, which allows for unlimited framerate:
+    * { VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_FIFO_KHR }
+    *
+    * To cap the framerate (I assume to the monitor refresh rate), just use:
+    * { VK_PRESENT_MODE_FIFO_KHR }
+    * 
+    * Would be better to make a more generic function that takes a list of prefered modes ordered by preference.
+    * Example code:
+    * 
+    * for (int request_i = 0; request_i < request_modes_count; request_i++)
+    *    for (uint32_t avail_i = 0; avail_i < avail_count; avail_i++)
+    *       if (request_modes[request_i] == avail_modes[avail_i])
+    *          return request_modes[request_i];
+    */
+
    for (const auto& availablePresentMode : availablePresentModes) {
       if (availablePresentMode == VK_PRESENT_MODE_MAILBOX_KHR) {
          return availablePresentMode;
-      }
-      else if (availablePresentMode == VK_PRESENT_MODE_IMMEDIATE_KHR) {
+      } else if (availablePresentMode == VK_PRESENT_MODE_IMMEDIATE_KHR) {
          bestMode = availablePresentMode;
       }
