summaryrefslogtreecommitdiff
path: root/opengl-bindings
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-03-20 14:02:32 +0100
committerHampusM <hampus@hampusmat.com>2026-03-20 14:02:32 +0100
commit9a442786c45ce05b4dc42cb07b654eac7671b35d (patch)
tree17d7c1d621bd1ade338158fb47d73d1c16075a20 /opengl-bindings
parenteca5ed3d7f6344eebbbf34cc10ef72c6a312fa43 (diff)
feat(opengl-bindings): add Buffer bind_to_indexed_target fn
Diffstat (limited to 'opengl-bindings')
-rw-r--r--opengl-bindings/Cargo.toml3
-rw-r--r--opengl-bindings/src/buffer.rs16
2 files changed, 18 insertions, 1 deletions
diff --git a/opengl-bindings/Cargo.toml b/opengl-bindings/Cargo.toml
index cac3c1e..b21cd74 100644
--- a/opengl-bindings/Cargo.toml
+++ b/opengl-bindings/Cargo.toml
@@ -63,5 +63,6 @@ gl_commands = [
"DebugMessageCallback",
"DebugMessageControl",
"DeleteVertexArrays",
- "DeleteBuffers"
+ "DeleteBuffers",
+ "BindBufferBase"
]
diff --git a/opengl-bindings/src/buffer.rs b/opengl-bindings/src/buffer.rs
index 66ab719..7d79d10 100644
--- a/opengl-bindings/src/buffer.rs
+++ b/opengl-bindings/src/buffer.rs
@@ -194,6 +194,22 @@ impl<Item: ReprC> Buffer<Item>
}
}
+ pub fn bind_to_indexed_target(
+ &self,
+ current_context: &CurrentContextWithFns<'_>,
+ target: BindingTarget,
+ index: u32,
+ )
+ {
+ unsafe {
+ current_context.fns().BindBufferBase(
+ target as crate::sys::types::GLenum,
+ index,
+ self.buf,
+ );
+ }
+ }
+
pub(crate) fn object(&self) -> crate::sys::types::GLuint
{
self.buf