Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision a926b7921f9a00a2222f0bc83a15b7222c92f7f9)
+++ new-game.cpp	(revision c4c205e95f423fdac631754ec14dc962e570370c)
@@ -65,4 +65,9 @@
    UNIFORM_1F,
    UNIFORM_3F,
+};
+
+enum UIValueType {
+   UIVALUE_INT,
+   UIVALUE_DOUBLE,
 };
 
@@ -142,4 +147,12 @@
 };
 
+struct UIValue {
+   UIValueType type;
+   string label;
+   void* value;
+
+   UIValue(UIValueType _type, string _label, void* _value) : type(_type), label(_label), value(_value) {}
+};
+
 void glfw_error_callback(int error, const char* description);
 
@@ -246,5 +259,7 @@
                   map<ObjectType, ShaderModelGroup>& modelGroups, GLuint ubo);
 
-void renderSceneGui();
+void renderSceneGui(map<string, vector<UIValue>> valueLists);
+
+void renderGuiValueList(vector<UIValue>& values);
 
 float getRandomNum(float low, float high);
@@ -264,7 +279,4 @@
 int width = 640;
 int height = 480;
-
-double fps;
-unsigned int score = 0;
 
 vec3 cam_pos;
@@ -752,4 +764,7 @@
 
 
+   double fps;
+   unsigned int score = 0;
+
    bool cam_moved = false;
 
@@ -767,4 +782,14 @@
 
    State curState = STATE_MAIN_MENU;
+
+   map<string, vector<UIValue>> valueLists;
+
+   valueLists["stats value list"] = vector<UIValue>();
+   valueLists["stats value list"].push_back(UIValue(UIVALUE_INT, "Score", &score));
+   valueLists["stats value list"].push_back(UIValue(UIVALUE_DOUBLE, "FPS", &fps));
+
+   valueLists["debug value list"] = vector<UIValue>();
+
+   //valueLists["debug value list"].push_back(UIValue(UIVALUE_INT, "Buffer offset", &bufferOffset));
 
    while (!glfwWindowShouldClose(window) && isRunning) {
@@ -1039,5 +1064,5 @@
          case STATE_GAME:
             renderScene(shaderBufferInfo, modelGroups, ubo);
-            renderSceneGui();
+            renderSceneGui(valueLists);
             break;
       }
@@ -2568,5 +2593,5 @@
 }
 
-void renderSceneGui() {
+void renderSceneGui(map<string, vector<UIValue>> valueLists) {
    ImGui_ImplGlfwGL3_NewFrame();
 
@@ -2593,8 +2618,4 @@
    */
 
-   stringstream ssScore, ssFps;
-   ssScore << "Score: " << score;
-   ssFps << "FPS:   " << fps;
-
    {
       ImGui::SetNextWindowSize(ImVec2(95, 46), ImGuiCond_Once);
@@ -2604,12 +2625,13 @@
          ImGuiWindowFlags_NoResize |
          ImGuiWindowFlags_NoMove);
-      ImGui::Text(ssScore.str().c_str());
-      ImGui::Text(ssFps.str().c_str());
+
+      renderGuiValueList(valueLists["stats value list"]);
+
       ImGui::End();
    }
 
    {
+      ImGui::SetNextWindowSize(ImVec2(250, 35), ImGuiCond_Once);
       ImGui::SetNextWindowPos(ImVec2(380, 10), ImGuiCond_Once);
-      ImGui::SetNextWindowSize(ImVec2(250, 35), ImGuiCond_Once);
       ImGui::Begin("WndMenubar", NULL,
          ImGuiWindowFlags_NoTitleBar |
@@ -2624,4 +2646,17 @@
    }
 
+   {
+      ImGui::SetNextWindowSize(ImVec2(200, 200), ImGuiCond_Once);
+      ImGui::SetNextWindowPos(ImVec2(430, 60), ImGuiCond_Once);
+      ImGui::Begin("WndDebug", NULL,
+         ImGuiWindowFlags_NoTitleBar |
+         ImGuiWindowFlags_NoResize |
+         ImGuiWindowFlags_NoMove);
+
+      renderGuiValueList(valueLists["debug value list"]);
+
+      ImGui::End();
+   }
+
    ImGui::Render();
    ImGui_ImplGlfwGL3_RenderDrawData(ImGui::GetDrawData());
@@ -2662,4 +2697,37 @@
    ImGui::Render();
    ImGui_ImplGlfwGL3_RenderDrawData(ImGui::GetDrawData());
+}
+
+void renderGuiValueList(vector<UIValue>& values) {
+   float maxWidth = 0.0f;
+   float cursorStartPos = ImGui::GetCursorPosX();
+
+   for (vector<UIValue>::iterator it = values.begin(); it != values.end(); it++) {
+      float textWidth = ImGui::CalcTextSize(it->label.c_str()).x;
+
+      if (maxWidth < textWidth)
+         maxWidth = textWidth;
+   }
+
+   stringstream ss;
+
+   for (vector<UIValue>::iterator it = values.begin(); it != values.end(); it++) {
+      ss.str("");
+      ss.clear();
+
+      switch (it->type) {
+         case UIVALUE_INT:
+            ss << it->label << ": " << *(unsigned int*)it->value;
+            break;
+         case UIVALUE_DOUBLE:
+            ss << it->label << ": " << *(double*)it->value;
+            break;
+      }
+
+      float textWidth = ImGui::CalcTextSize(it->label.c_str()).x;
+
+      ImGui::SetCursorPosX(cursorStartPos + maxWidth - textWidth);
+      ImGui::Text("%s", ss.str().c_str());
+   }
 }
 
