Struct crayon::video::command::CommandBuffer
source · pub struct CommandBuffer { /* private fields */ }
Expand description
The command buffer of video system.
Implementations§
source§impl CommandBuffer
impl CommandBuffer
sourcepub fn update_scissor(&mut self, scissor: SurfaceScissor)
pub fn update_scissor(&mut self, scissor: SurfaceScissor)
Updates the scissor test of surface.
The test is initially disabled. While the test is enabled, only pixels that lie within the scissor box can be modified by drawing commands.
sourcepub fn update_viewport(&mut self, viewport: SurfaceViewport)
pub fn update_viewport(&mut self, viewport: SurfaceViewport)
Updates the viewport of surface.
sourcepub fn update_texture(&mut self, id: TextureHandle, area: Aabb2<u32>, bytes: &[u8])
pub fn update_texture(&mut self, id: TextureHandle, area: Aabb2<u32>, bytes: &[u8])
Update a contiguous subregion of an existing two-dimensional texture object.
sourcepub fn update_vertex_buffer(&mut self, id: MeshHandle, offset: usize, bytes: &[u8])
pub fn update_vertex_buffer(&mut self, id: MeshHandle, offset: usize, bytes: &[u8])
Update a subset of dynamic vertex buffer. Use offset
specifies the offset
into the buffer object’s data store where data replacement will begin, measured
in bytes.
sourcepub fn update_index_buffer(&mut self, id: MeshHandle, offset: usize, bytes: &[u8])
pub fn update_index_buffer(&mut self, id: MeshHandle, offset: usize, bytes: &[u8])
Update a subset of dynamic index buffer. Use offset
specifies the offset
into the buffer object’s data store where data replacement will begin, measured
in bytes.
sourcepub fn submit(&mut self, surface: SurfaceHandle) -> Result<()>
pub fn submit(&mut self, surface: SurfaceHandle) -> Result<()>
Clears the batch, and submits all the commands into video device. Its guaranteed that all the commands in this batch will be executed one by one in order.
Notes that this method has no effect on the allocated capacity of the underlying storage.
Trait Implementations§
source§impl Default for CommandBuffer
impl Default for CommandBuffer
source§fn default() -> CommandBuffer
fn default() -> CommandBuffer
Auto Trait Implementations§
impl RefUnwindSafe for CommandBuffer
impl Send for CommandBuffer
impl Sync for CommandBuffer
impl Unpin for CommandBuffer
impl UnwindSafe for CommandBuffer
Blanket Implementations§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more