Skip to content

Commit

Permalink
Add function call for NamedBufferStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyces committed Dec 26, 2024
1 parent 83c7b9b commit e63bbb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ pub trait HasContext: __private::Sealed {

unsafe fn buffer_storage(&self, target: u32, size: i32, data: Option<&[u8]>, flags: u32);

unsafe fn named_buffer_storage(&self, target: Self::Buffer, size: i32, data: Option<&[u8]>, flags: u32);

unsafe fn check_framebuffer_status(&self, target: u32) -> u32;

unsafe fn check_named_framebuffer_status(
Expand Down
5 changes: 5 additions & 0 deletions src/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,11 @@ impl HasContext for Context {
gl.BufferStorageEXT(target, size, data, flags);
}
}
unsafe fn named_buffer_storage(&self, buffer: Self::Buffer, size: i32, data: Option<&[u8]>, flags: u32) {
let gl = &self.raw;
let data = data.map(|p| p.as_ptr()).unwrap_or(std::ptr::null()) as *const std::ffi::c_void;
gl.NamedBufferStorage(buffer.0.get(), size as isize, data, flags);
}

unsafe fn check_framebuffer_status(&self, target: u32) -> u32 {
let gl = &self.raw;
Expand Down

0 comments on commit e63bbb2

Please sign in to comment.