From 038aead236e77f41e6d229510a5e25741a6815c6 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 28 May 2026 19:56:43 +0200 Subject: refactor(opengl-bindings): remove CurrentContextWithFns --- opengl-bindings/src/buffer.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'opengl-bindings/src/buffer.rs') diff --git a/opengl-bindings/src/buffer.rs b/opengl-bindings/src/buffer.rs index edbf2a3..5045855 100644 --- a/opengl-bindings/src/buffer.rs +++ b/opengl-bindings/src/buffer.rs @@ -4,7 +4,7 @@ use std::ptr::null; use safer_ffi::layout::ReprC; -use crate::CurrentContextWithFns; +use crate::MaybeCurrentContextWithFns; #[derive(Debug)] pub struct Buffer @@ -16,7 +16,7 @@ pub struct Buffer impl Buffer { #[must_use] - pub fn new(current_context: &CurrentContextWithFns<'_>) -> Self + pub fn new(current_context: &MaybeCurrentContextWithFns) -> Self { let mut buffer = crate::sys::types::GLuint::default(); @@ -33,7 +33,7 @@ impl Buffer /// Returns `Err` if the size (in bytes) is too large. pub fn init( &self, - current_context: &CurrentContextWithFns<'_>, + current_context: &MaybeCurrentContextWithFns, size: usize, usage: Usage, ) -> Result<(), Error> @@ -62,7 +62,7 @@ impl Buffer /// Returns `Err` if the total size (in bytes) is too large. pub fn store( &self, - current_context: &CurrentContextWithFns<'_>, + current_context: &MaybeCurrentContextWithFns, items: &[Item], usage: Usage, ) -> Result<(), Error> @@ -93,7 +93,7 @@ impl Buffer /// Returns `Err` if the total size (in bytes) is too large. pub fn store_at_byte_offset( &self, - current_context: &CurrentContextWithFns<'_>, + current_context: &MaybeCurrentContextWithFns, byte_offset: usize, items: &[Item], // usage: Usage, @@ -135,7 +135,7 @@ impl Buffer /// Returns `Err` if the total size (in bytes) is too large. pub fn store_mapped( &self, - current_context: &CurrentContextWithFns<'_>, + current_context: &MaybeCurrentContextWithFns, values: &[Value], usage: Usage, mut map_func: impl FnMut(&Value) -> Item, @@ -187,7 +187,7 @@ impl Buffer Ok(()) } - pub fn delete(&self, current_context: &CurrentContextWithFns<'_>) + pub fn delete(&self, current_context: &MaybeCurrentContextWithFns) { unsafe { current_context.fns().DeleteBuffers(1, &raw const self.buf); @@ -196,7 +196,7 @@ impl Buffer pub fn bind_to_indexed_target( &self, - current_context: &CurrentContextWithFns<'_>, + current_context: &MaybeCurrentContextWithFns, target: BindingTarget, index: u32, ) -- cgit v1.2.3-18-g5258