summaryrefslogtreecommitdiff
path: root/opengl-bindings/src/buffer.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-05-28 19:56:43 +0200
committerHampusM <hampus@hampusmat.com>2026-05-28 19:56:43 +0200
commit038aead236e77f41e6d229510a5e25741a6815c6 (patch)
treefe50c328568f656e3528bef56b550b6b836c7102 /opengl-bindings/src/buffer.rs
parentaba4f418af2e514c78fe06a1c98949670eaeacd9 (diff)
refactor(opengl-bindings): remove CurrentContextWithFns
Diffstat (limited to 'opengl-bindings/src/buffer.rs')
-rw-r--r--opengl-bindings/src/buffer.rs16
1 files changed, 8 insertions, 8 deletions
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<Item: ReprC>
@@ -16,7 +16,7 @@ pub struct Buffer<Item: ReprC>
impl<Item: ReprC> Buffer<Item>
{
#[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<Item: ReprC> Buffer<Item>
/// 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<Item: ReprC> Buffer<Item>
/// 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<Item: ReprC> Buffer<Item>
/// 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<Item: ReprC> Buffer<Item>
/// Returns `Err` if the total size (in bytes) is too large.
pub fn store_mapped<Value>(
&self,
- current_context: &CurrentContextWithFns<'_>,
+ current_context: &MaybeCurrentContextWithFns,
values: &[Value],
usage: Usage,
mut map_func: impl FnMut(&Value) -> Item,
@@ -187,7 +187,7 @@ impl<Item: ReprC> Buffer<Item>
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<Item: ReprC> Buffer<Item>
pub fn bind_to_indexed_target(
&self,
- current_context: &CurrentContextWithFns<'_>,
+ current_context: &MaybeCurrentContextWithFns,
target: BindingTarget,
index: u32,
)