diff options
| author | HampusM <hampus@hampusmat.com> | 2026-04-01 14:25:00 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-04-01 14:25:00 +0200 |
| commit | b418dd08ad4b9f508cdd29580437d981dbaf3dcd (patch) | |
| tree | 645a12503290427100f7307a92061aa334d8f05d /opengl-bindings/src | |
| parent | e871a823ed9814b3c2551c617ebd360fa2296510 (diff) | |
fix(opengl-bindings): make element offset into byte offset before draw
Diffstat (limited to 'opengl-bindings/src')
| -rw-r--r-- | opengl-bindings/src/vertex_array.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/opengl-bindings/src/vertex_array.rs b/opengl-bindings/src/vertex_array.rs index 5de59d8..3f4b566 100644 --- a/opengl-bindings/src/vertex_array.rs +++ b/opengl-bindings/src/vertex_array.rs @@ -103,7 +103,9 @@ impl VertexArray // TODO: Make this not sometimes UB. DrawElements expects a actual // pointer to a memory location when no VBO is bound. // See: https://stackoverflow.com/q/21706113 - std::ptr::without_provenance::<c_void>(element_offset as usize), + std::ptr::without_provenance::<c_void>( + element_offset as usize * size_of::<u32>(), + ), vertex_offset, ); } |
