diff options
| author | LLLL Colonq <llll@colonq> | 2024-10-13 23:46:06 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-10-13 23:46:06 -0400 |
| commit | 3efd3026d22c71e95a853985f3f50f52147d287e (patch) | |
| tree | 86d6e50f41cf389089ac24e1c83d2b28f60922d9 /src/mesh.rs | |
| parent | b86e6259278892b85aa07da4b98e2d7daf807e21 (diff) | |
Instanced rendering, mouse move event
Diffstat (limited to 'src/mesh.rs')
| -rw-r--r-- | src/mesh.rs | 7 |
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 _); + } + } } |
