int main(int argc, char** argv) { for (int i = 0; i < M.GetLayers(); i++) { M.Show(i); printf("\n"); } current_elevator_i = M.getElevatorI(); current_elevator_j = M.getElevatorJ(); fvc = read_obj("flashlight.obj", fv, ftv, fn); initGLUT(&argc, argv); initGLEW(); initOpenGL(); glutKeyboardFunc(Movement); glutWarpPointer(200, 200); glutMotionFunc(MouseActiveMotion); glutPassiveMotionFunc(MouseMotion); glutMouseFunc(MouseButtons); glutMainLoop(); freeVAO(); freeVBO(); cleanShaders(); return 0; }
LTexture::~LTexture() { //Free texture data if needed freeTexture(); //Free VBO and IBO if needed freeVBO(); }
Image::~Image() { freeVBO(); }
Array<Vec3i>& mutableIndices (int submesh) { FW_ASSERT(isInMemory()); freeVBO(); return *m_submeshes[submesh].indices; }
U8* addVertices (const void* ptr, int num) { FW_ASSERT(isInMemory() && num >= 0); freeVBO(); m_numVertices += num; U8* slot = m_vertices.add(NULL, num * m_stride); if (ptr) memcpy(slot, ptr, num * m_stride); return slot; }
U8* getMutableVertexPtr (int idx = 0) { FW_ASSERT(isInMemory() && idx >= 0 && idx <= numVertices()); freeVBO(); return m_vertices.getPtr() + idx * m_stride; }