|
|
|
|
@ -145,6 +145,28 @@ roDraw(render_objects* r_objs,
|
|
|
|
|
drawDefault(r_objs, world_transform, cam, sw, lights); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
roUpdateSimpleMesh(render_objects* r_objs, simple_mesh* mesh, GLenum draw_mode) |
|
|
|
|
{ |
|
|
|
|
assert(r_objs != nullptr && r_objs->objects != nullptr); |
|
|
|
|
assert(mesh != nullptr && mesh->vertices != nullptr); |
|
|
|
|
simple_render_object* sro = (simple_render_object*) r_objs->objects; |
|
|
|
|
assert(sro->vertex_count == mesh->num_vertices); |
|
|
|
|
|
|
|
|
|
sro->draw_mode = draw_mode; |
|
|
|
|
glBindBuffer(GL_ARRAY_BUFFER, sro->vertex_buffer_id); |
|
|
|
|
glBufferSubData( |
|
|
|
|
GL_ARRAY_BUFFER, |
|
|
|
|
0, |
|
|
|
|
sro->vertex_count * sizeof(GLfloat), |
|
|
|
|
mesh->vertices); |
|
|
|
|
glBindBuffer(GL_ARRAY_BUFFER, sro->vertex_color_buffer_id); |
|
|
|
|
glBufferSubData( |
|
|
|
|
GL_ARRAY_BUFFER, |
|
|
|
|
0, |
|
|
|
|
sro->vertex_count * sizeof(GLfloat), |
|
|
|
|
mesh->vert_colors); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// internal
|
|
|
|
|
|
|
|
|
|
|