+ tex_coords.clear();
+ indices.clear();
+}
+
+bool MeshVK::update_vertex_data()
+{
+ if(vertices.empty()) {
+ printf("empty vertices!\n");
+ return false;
+ }
+
+ /* create the buffers */
+
+ if(!(vk_vertices = vku_create_buffer(vertices.size() * sizeof(Vec3),
+ VK_BUFFER_USAGE_VERTEX_BUFFER_BIT))) {
+ fprintf(stderr, "Failed to create the buffer for the vertices.\n");
+ return false;
+ }
+
+ if(!(vk_normals = vku_create_buffer(normals.size() * sizeof(Vec3),
+ VK_BUFFER_USAGE_VERTEX_BUFFER_BIT))) {
+ vku_destroy_buffer(vk_vertices);
+
+ fprintf(stderr, "Failed to create the buffer for the normals.\n");
+ return false;
+ }
+
+ if(!(vk_tex_coords = vku_create_buffer(tex_coords.size() * sizeof(Vec2),
+ VK_BUFFER_USAGE_VERTEX_BUFFER_BIT))) {
+ vku_destroy_buffer(vk_vertices);
+ vku_destroy_buffer(vk_normals);
+
+ fprintf(stderr,
+ "Failed to create the buffer for the texture coordinates.\n");
+ return false;
+ }
+
+ if(!(vk_indices = vku_create_buffer(indices.size() * 2,
+ VK_BUFFER_USAGE_INDEX_BUFFER_BIT))) {
+ vku_destroy_buffer(vk_vertices);
+ vku_destroy_buffer(vk_normals);
+ vku_destroy_buffer(vk_tex_coords);
+
+ fprintf(stderr, "Failed to create the indices buffer.\n");
+ return false;
+ }
+
+ /* map the buffers */
+
+ //TODO this is going to change when we allocate one mem block for all data,
+ //for the moment we map each buffer memory block and we set the data
+
+ return true;