Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision b05e2b5ec11655ffea5bb44d8a3911f6adc3c15d)
+++ new-game.cpp	(revision a926b7921f9a00a2222f0bc83a15b7222c92f7f9)
@@ -521,20 +521,4 @@
    initModelGroupAttribs(modelGroups[TYPE_SHIP]);
 
-   glBindBuffer(GL_ARRAY_BUFFER, points_vbo);
-   glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL);
-   modelGroups[TYPE_SHIP].attribs["vertex_position"].buffer = points_vbo;
-
-   glBindBuffer(GL_ARRAY_BUFFER, colors_vbo);
-   glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, NULL);
-   modelGroups[TYPE_SHIP].attribs["vertex_color"].buffer = colors_vbo;
-
-   glBindBuffer(GL_ARRAY_BUFFER, normals_vbo);
-   glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 0, NULL);
-   modelGroups[TYPE_SHIP].attribs["vertex_normal"].buffer = normals_vbo;
-
-   glBindBuffer(GL_ARRAY_BUFFER, model_mat_idx_vbo);
-   glVertexAttribIPointer(3, 1, GL_UNSIGNED_INT, 0, NULL);
-   modelGroups[TYPE_SHIP].attribs["ubo_index"].buffer = model_mat_idx_vbo;
-
    modelGroups[TYPE_ASTEROID] = createModelGroup(
       loadShaderProgram("./asteroid.vert", "./asteroid.frag"));
@@ -635,6 +619,5 @@
 
    // player ship
-   SceneObject* ship = createShip();
-   objects.push_back(ship);
+   objects.push_back(createShip());
 
    vector<SceneObject>::iterator obj_it;
@@ -1987,4 +1970,9 @@
 }
 
+// TODO: Add the code to resize the buffers here
+// addObjectToScene and removeObjectFromScene pretty much already do this.
+// However, when addObjectToScene resizes the buffers, it resizes them for all object types
+// It would be more efficient to only resize them for the object type in question
+
 void removeModelFromGroup(ShaderModelGroup& modelGroup, SceneObject& model) {
    // TODO: Implement
@@ -2277,16 +2265,25 @@
       smg->numPoints = 0;
       smg->vboCapacity = shaderCounts[smg->shaderProgram] * 2;
-      /*
-      if (modelGroupIt->first == TYPE_LASER) {
-         smg = &modelGroups[modelGroupIt->first];
-         smg->numPoints = shaderCounts[smg->shaderProgram];
-
-         // Here, I could add glBufferData calls to allocate space for laser buffers
-         if (modelGroupIt->first == TYPE_LASER) {
-            glBindBuffer(GL_ARRAY_BUFFER, smg->attribs["vertex_position"].buffer);
-            glBufferData(GL_ARRAY_BUFFER, smg->numPoints * sizeof(GLfloat) * smg->attribs["vertex_position"].size, NULL, GL_DYNAMIC_DRAW);
-         }
-      }
-      */
+
+      if (modelGroupIt->first == TYPE_SHIP) {
+         int numPoints = shaderCounts[smg->shaderProgram];
+         AttribInfo* attrib;
+
+         attrib = &smg->attribs["vertex_position"];
+         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
+         glBufferData(GL_ARRAY_BUFFER, numPoints * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
+
+         attrib = &smg->attribs["vertex_color"];
+         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
+         glBufferData(GL_ARRAY_BUFFER, numPoints * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
+
+         attrib = &smg->attribs["vertex_normal"];
+         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
+         glBufferData(GL_ARRAY_BUFFER, numPoints * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
+
+         attrib = &smg->attribs["ubo_index"];
+         glBindBuffer(GL_ARRAY_BUFFER, attrib->buffer);
+         glBufferData(GL_ARRAY_BUFFER, numPoints * GLsizeof(attrib->type) * attrib->size, NULL, GL_DYNAMIC_DRAW);
+      }
    }
 
@@ -2322,5 +2319,9 @@
    BufferInfo* bufferInfo = &shaderBufferInfo[modelGroups[obj.type].shaderProgram];
 
-   obj.vertex_vbo_offset = bufferInfo->vbo_base + modelGroups[obj.type].numPoints;
+   if (obj.type == TYPE_SHIP) {
+      obj.vertex_vbo_offset = modelGroups[obj.type].numPoints;
+   } else {
+      obj.vertex_vbo_offset = bufferInfo->vbo_base + modelGroups[obj.type].numPoints;
+   }
    obj.ubo_offset = bufferInfo->ubo_base + bufferInfo->ubo_offset;
 
@@ -2347,5 +2348,5 @@
                break;
             case ATTRIB_UNIFORM:
-              break;
+               break;
          }
       }
@@ -2536,5 +2537,5 @@
    glBindVertexArray(modelGroups[TYPE_SHIP].vao);
 
-   glDrawArrays(GL_TRIANGLES, shaderBufferInfo[modelGroups[TYPE_SHIP].shaderProgram].vbo_base, modelGroups[TYPE_SHIP].numPoints);
+   glDrawArrays(GL_TRIANGLES, 0, modelGroups[TYPE_SHIP].numPoints);
 
    glUseProgram(modelGroups[TYPE_ASTEROID].shaderProgram);
