pub struct UniformBuffer<G>where
G: Gl,{ /* private fields */ }
Expand description
Creates a UniformBuffer that may contain the data for a number of program Uniforms
For simplicity in OpenGl/WebGl this also creates the backing GlBuffer
A program’s uniform is bound to a range of one of these
Implementations§
Source§impl<G> UniformBuffer<G>where
G: Gl,
impl<G> UniformBuffer<G>where
G: Gl,
pub fn of_data<F: Sized>( context: &mut G, data: &[F], is_dynamic: bool, ) -> Result<Self, ()>
pub fn new(gl_buffer: <G as Gl>::Buffer, byte_length: usize) -> Self
Sourcepub fn gl_buffer(&self) -> &<G as Gl>::Buffer
pub fn gl_buffer(&self) -> &<G as Gl>::Buffer
Get the gl_buffer associated with the data, assuming its
gl_create
method has been invoked at least once
pub fn byte_length(&self) -> usize
pub fn offset_and_length( &self, byte_offset: usize, byte_length: usize, ) -> (usize, usize)
Trait Implementations§
Auto Trait Implementations§
impl<G> Freeze for UniformBuffer<G>
impl<G> RefUnwindSafe for UniformBuffer<G>
impl<G> Send for UniformBuffer<G>
impl<G> Sync for UniformBuffer<G>
impl<G> Unpin for UniformBuffer<G>
impl<G> UnwindSafe for UniformBuffer<G>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more