summaryrefslogtreecommitdiff
path: root/opengl-bindings
diff options
context:
space:
mode:
Diffstat (limited to 'opengl-bindings')
-rw-r--r--opengl-bindings/src/vertex_array.rs4
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,
);
}