summaryrefslogtreecommitdiff
path: root/src/mesh.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh.rs')
-rw-r--r--src/mesh.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesh.rs b/src/mesh.rs
index 2f54903..aba9957 100644
--- a/src/mesh.rs
+++ b/src/mesh.rs
@@ -115,4 +115,11 @@ impl Mesh {
ctx.gl.draw_elements(glow::TRIANGLES, self.index_count as _, glow::UNSIGNED_INT, 0);
}
}
+
+ pub fn render_instanced(&self, ctx: &context::Context, count: u64) {
+ unsafe {
+ ctx.gl.bind_vertex_array(Some(self.vao));
+ ctx.gl.draw_elements_instanced(glow::TRIANGLES, self.index_count as _, glow::UNSIGNED_INT, 0, count as _);
+ }
+ }
}