Struct imgui_wgpu::Texture
source · [−]pub struct Texture { /* private fields */ }
Expand description
A container for a bindable texture.
Implementations
sourceimpl Texture
impl Texture
sourcepub fn from_raw_parts(
texture: Texture,
view: TextureView,
bind_group: BindGroup,
size: Extent3d
) -> Self
pub fn from_raw_parts(
texture: Texture,
view: TextureView,
bind_group: BindGroup,
size: Extent3d
) -> Self
Create a Texture
from its raw parts.
sourcepub fn new(
device: &Device,
renderer: &Renderer,
config: TextureConfig<'_>
) -> Self
pub fn new(
device: &Device,
renderer: &Renderer,
config: TextureConfig<'_>
) -> Self
Create a new GPU texture width the specified config
.
sourcepub fn write(&self, queue: &Queue, data: &[u8], width: u32, height: u32)
pub fn write(&self, queue: &Queue, data: &[u8], width: u32, height: u32)
Write data
to the texture.
data
: 32-bit RGBA bitmap data.width
: The width of the source bitmap (data
) in pixels.height
: The height of the source bitmap (data
) in pixels.
sourcepub fn view(&self) -> &TextureView
pub fn view(&self) -> &TextureView
The wgpu::TextureView
of the underlying texture.
Auto Trait Implementations
impl !RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl !UnwindSafe for Texture
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more