Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision cb01aff8c1cbf5776d9d368a03abddcc899f8224)
+++ new-game.cpp	(revision cabdd5c9539be1c075e4082031bd73d0272c3245)
@@ -287,4 +287,5 @@
 */
 
+/*** START OF REFACTORED CODE ***/
 // Helps to test logging during crashes
 void badFunc() {
@@ -368,4 +369,5 @@
       cout << "OpenGL debug message callback is not supported" << endl;
    }
+/*** END OF REFACTORED CODE ***/
 
    srand(time(0));
@@ -955,10 +957,9 @@
       bindUniformData(modelGroups[TYPE_EXPLOSION].attribs["cur_time"]);
 
+/*** START OF REFACTORED CODE ***/
       // Render scene
 
       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-      // Anton's book suggests placing this here, after glClear(). Check it's impact on framerate
-      //glViewport(0, 0, windowWidth, windowHeight);
+/*** END OF REFACTORED CODE ***/
 
       switch (curState) {
Index: vulkan-ref.cpp
===================================================================
--- vulkan-ref.cpp	(revision cb01aff8c1cbf5776d9d368a03abddcc899f8224)
+++ vulkan-ref.cpp	(revision cabdd5c9539be1c075e4082031bd73d0272c3245)
@@ -108,4 +108,5 @@
 };
 
+/*** START OF REFACTORED CODE ***/
 VkResult CreateDebugUtilsMessengerEXT(VkInstance instance,
       const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
@@ -144,9 +145,9 @@
    private:
       GameGui* gui = new GameGui_SDL();
+
       SDL_version sdlVersion;
       SDL_Window* window = nullptr;
-
-      // TODO: Come up with more descriptive names for these
       SDL_Renderer* gRenderer = nullptr;
+/*** END OF REFACTORED CODE ***/
       SDL_Texture* uiOverlay = nullptr;
 
@@ -155,6 +156,8 @@
       SDL_Texture* uiImage = nullptr;
 
+/*** START OF REFACTORED CODE ***/
       VkInstance instance;
       VkDebugUtilsMessengerEXT debugMessenger;
+/*** END OF REFACTORED CODE ***/
       VkSurfaceKHR surface;
 
@@ -222,9 +225,6 @@
       bool framebufferResized = false;
 
-      // TODO: Make make some more initi functions, or call this initUI if the
-      // amount of things initialized here keeps growing
+/*** START OF REFACTORED CODE ***/
       bool initWindow() {
-         // TODO: Put all fonts, textures, and images in the assets folder
-
          if (gui->init() == RTWO_ERROR) {
             cout << "UI library could not be initialized!" << endl;
@@ -245,4 +245,5 @@
             return RTWO_ERROR;
          }
+/*** END OF REFACTORED CODE ***/
 
          SDL_VERSION(&sdlVersion);
@@ -307,7 +308,9 @@
       }
 
+/*** START OF REFACTORED CODE ***/
       void initVulkan() {
          createInstance();
          setupDebugMessenger();
+/*** END OF REFACTORED CODE ***/
          createSurface();
          pickPhysicalDevice();
@@ -459,4 +462,5 @@
       }
 
+/*** START OF REFACTORED CODE ***/
       vector<const char*> getRequiredExtensions() {
          vector<const char*> extensions = gui->getRequiredExtensions();
@@ -487,4 +491,5 @@
          createInfo.pfnUserCallback = debugCallback;
       }
+      /*** END OF REFACTORED CODE ***/
 
       void createSurface() {
@@ -708,12 +713,8 @@
          if (capabilities.currentExtent.width != numeric_limits<uint32_t>::max()) {
             return capabilities.currentExtent;
-         }
-         else {
-            int width, height;
-            gui->getWindowSize(&width, &height);
-
+         } else {
             VkExtent2D actualExtent = {
-               static_cast<uint32_t>(width),
-               static_cast<uint32_t>(height)
+               static_cast<uint32_t>(gui->getWindowWidth()),
+               static_cast<uint32_t>(gui->getWindowHeight())
             };
 
@@ -1811,12 +1812,10 @@
 
       void recreateSwapChain() {
-         int width = 0, height = 0;
-
-         gui->getWindowSize(&width, &height);
-
-         while (width == 0 || height == 0 ||
+         gui->refreshWindowSize();
+
+         while (gui->getWindowWidth() == 0 || gui->getWindowHeight() == 0 ||
             (SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED) != 0) {
             SDL_WaitEvent(nullptr);
-            gui->getWindowSize(&width, &height);
+            gui->refreshWindowSize();
          }
 
@@ -1875,13 +1874,14 @@
 
          vkDestroyCommandPool(device, commandPool, nullptr);
-
          vkDestroyDevice(device, nullptr);
-
+         vkDestroySurfaceKHR(instance, surface, nullptr);
+
+/*** START OF REFACTORED CODE ***/
          if (enableValidationLayers) {
             DestroyDebugUtilsMessengerEXT(instance, debugMessenger, nullptr);
          }
 
-         vkDestroySurfaceKHR(instance, surface, nullptr);
          vkDestroyInstance(instance, nullptr);
+/*** END OF REFACTORED CODE ***/
 
          // TODO: Check if any of these functions accept null parameters
@@ -1906,4 +1906,5 @@
          }
 
+/*** START OF REFACTORED CODE ***/
          SDL_DestroyRenderer(gRenderer);
          gRenderer = nullptr;
@@ -1912,4 +1913,5 @@
          gui->shutdown();
          delete gui;
+/*** END OF REFACTORED CODE ***/
       }
 
@@ -1986,4 +1988,5 @@
 };
 
+/*** START OF REFACTORED CODE ***/
 int main(int argc, char* argv[]) {
 
@@ -2009,2 +2012,3 @@
    return EXIT_SUCCESS;
 }
+/*** END OF REFACTORED CODE ***/
