Implemented void render_chunk
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user