diff options
| author | HampusM <hampus@hampusmat.com> | 2025-11-07 13:54:54 +0100 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2025-11-07 13:54:54 +0100 |
| commit | 262092066834f0bf4848f0cd8a3bc6c851118881 (patch) | |
| tree | b2d2019264c01e7eb2fb22908ad163bb67017c6c /opengl-bindings/src/buffer.rs | |
| parent | a523c4308703c41215c8688c1c9bf1eb3908ddac (diff) | |
feat(opengl-bindings): add Buffer & VertexArray delete fns
Diffstat (limited to 'opengl-bindings/src/buffer.rs')
| -rw-r--r-- | opengl-bindings/src/buffer.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/opengl-bindings/src/buffer.rs b/opengl-bindings/src/buffer.rs index c64ec8d..4c91649 100644 --- a/opengl-bindings/src/buffer.rs +++ b/opengl-bindings/src/buffer.rs @@ -105,7 +105,7 @@ impl<Item: ReprC> Buffer<Item> let Ok(offset_casted) = crate::sys::types::GLintptr::try_from(offset) else { unreachable!(); // Reason: The total size can be casted to a GLintptr - // (done above) so offsets should be castable as well + // (done above) so offsets should be castable as well }; unsafe { @@ -121,6 +121,13 @@ impl<Item: ReprC> Buffer<Item> Ok(()) } + pub fn delete(&self, current_context: &CurrentContextWithFns<'_>) + { + unsafe { + current_context.fns().DeleteBuffers(1, &raw const self.buf); + } + } + pub(crate) fn object(&self) -> crate::sys::types::GLuint { self.buf |
