summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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