diff --git a/src/inc/chunk.hpp b/src/inc/chunk.hpp index acd67f1..207ed30 100644 --- a/src/inc/chunk.hpp +++ b/src/inc/chunk.hpp @@ -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); + } +} \ No newline at end of file