Struct ccthw::graphics::vulkan_api::TextureLoader
source · pub struct TextureLoader { /* private fields */ }
Implementations§
source§impl TextureLoader
impl TextureLoader
sourcepub unsafe fn new(
render_device: Arc<RenderDevice>
) -> Result<Self, GraphicsError>
pub unsafe fn new( render_device: Arc<RenderDevice> ) -> Result<Self, GraphicsError>
Create a new Texture Loader which can build textures from images on the harddrive.
Safety
Unsafe because:
- the application must call destroy on this instance before the render device is dropped.
sourcepub unsafe fn load_texture_2d(
&mut self,
texture_path: impl AsRef<Path>
) -> Result<Texture2D, GraphicsError>
pub unsafe fn load_texture_2d( &mut self, texture_path: impl AsRef<Path> ) -> Result<Texture2D, GraphicsError>
Read image data from a file on disk and create a 2D texture.
Safety
Unsafe because:
- the caller is responsible for destroying the returned texture before render device is dropped
Auto Trait Implementations§
impl RefUnwindSafe for TextureLoader
impl !Send for TextureLoader
impl !Sync for TextureLoader
impl Unpin for TextureLoader
impl UnwindSafe for TextureLoader
Blanket Implementations§
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.