Implemented void render_chunk

This commit is contained in:
CobaltXII
2018-12-30 13:51:12 -05:00
parent e9c794aeb7
commit 01b468402b

View File

@@ -141,3 +141,22 @@ void deallocate_chunk(chunk* to_be_annihilated)
delete to_be_annihilated;
}
// Render a chunk.
void render_chunk(chunk* the_chunk)
{
if (the_chunk->target_size_in_floats > 0)
{
// Bind the target_vao to the current state.
glBindVertexArray(the_chunk->target_vao);
// Draw the vertex array object as an array of triangles.
glDrawArrays(GL_TRIANGLES, 0, the_chunk->target_size_in_floats / 7);
// Unbind the target_vao from the current state.
glBindVertexArray(0);
}
}