Struct cat_engine_basement::graphics::core::buffer::Buffer [−][src]
pub struct Buffer { /* fields omitted */ }
Implementations
Generates a buffer object.
Deletes a buffer object.
Binds a named buffer object.
When a buffer object is bound to a target, the previous binding for that target is automatically broken.
GLError::InvalidValue
is generated if buffer
is not a name previously returned from a call to generate
.
Binds a range within a buffer object to an indexed buffer target.
GLError::InvalidValue
is generated if buffer
is not a name previously returned from a call to Buffer::generate
,
if index
is greater than or equal to the number of target-specific indexed binding points,
if buffer does not have an associated data store, or if the size of that store is zero.
pub unsafe fn bind_range(
&self,
target: BufferIndexedTarget,
index: u32,
buffer: u32,
offset: isize,
size: isize
)
pub unsafe fn bind_range(
&self,
target: BufferIndexedTarget,
index: u32,
buffer: u32,
offset: isize,
size: isize
)
Binds a range within a buffer object to an indexed buffer target.
GLError::InvalidValue
is generated if buffer
is not a name previously returned from a call to Buffer::generate
,
if index
is greater than or equal to the number of target-specific indexed binding points,
if size
is less than or equal to zero, or if offset + size
is greater than the value of GL_BUFFER_SIZE.
Additional errors may be generated if offset violates any target-specific alignmemt restrictions.
pub unsafe fn rewrite<I: Sized>(
&self,
target: BufferTarget,
size: isize,
data: *const I,
usage: BufferUsage
)
pub unsafe fn rewrite<I: Sized>(
&self,
target: BufferTarget,
size: isize,
data: *const I,
usage: BufferUsage
)
Creates and initializes a buffer object’s data store.
GLError::InvalidValue
is generated if size
is negative.
GLError::InvalidOperation
is generated if the reserved buffer object name 0 is bound to target
.
GLError::OutOfMemory
is generated if the GL is unable to create a data store with the specified size.
Updates a subset of a buffer object’s data store.
GLError::InvalidValue
is generated if offset
or size
is negative,
or if together they define a region of memory that extends beyond the buffer object’s allocated data store.
GLError::InvalidOperation
is generated
if the reserved buffer object name 0 is bound to target
,
or if the buffer object being updated is mapped.
pub unsafe fn copy_buffer(
&self,
read_target: BufferTarget,
write_target: BufferTarget,
read_offset: isize,
write_offset: isize,
size: isize
)
pub unsafe fn copy_buffer(
&self,
read_target: BufferTarget,
write_target: BufferTarget,
read_offset: isize,
write_offset: isize,
size: isize
)
Copies part of the data store of a buffer object to the data store of another buffer object.
GLError::InvalidValue
is generated
if any of read_offset
, write_offset
or size
is negative,
if read_offset + size
exceeds the size of the buffer object bound to read_target
,
if write_offset + size
exceeds the size of the buffer object bound to write_target
,
or if the same buffer object is bound to both read_target
and write_target
and the ranges [read_offset, read_offset + size)
and [write_offset, writeo_offset + size)
overlap.
GLError::InvalidOperation
is generated if zero is bound to read_target
or write_target
,
or if the buffer object bound to either read_target
or write_target
is mapped.