Struct imgui_wgpu::Texture
source · pub struct Texture { /* private fields */ }
Expand description
A container for a bindable texture.
Implementations§
source§impl Texture
impl Texture
sourcepub fn from_raw_parts(
device: &Device,
renderer: &Renderer,
texture: Arc<Texture>,
view: Arc<TextureView>,
bind_group: Option<Arc<BindGroup>>,
config: Option<&RawTextureConfig<'_>>,
size: Extent3d
) -> Self
pub fn from_raw_parts( device: &Device, renderer: &Renderer, texture: Arc<Texture>, view: Arc<TextureView>, bind_group: Option<Arc<BindGroup>>, config: Option<&RawTextureConfig<'_>>, size: Extent3d ) -> Self
Create a Texture
from its raw parts.
bind_group
: The bind group used by the texture. If it isNone
, the bind group will be created like inSelf::new
.config
: The config used for creating the bind group. Ifbind_group
isSome(_)
, it will be ignored
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.