Struct let_engine::Resources
source · pub struct Resources { /* private fields */ }
Implementations§
source§impl Resources
impl Resources
pub fn load_font(&self, font: &[u8]) -> Arc<GameFont>
pub fn load_texture_from_raw( &self, texture: &[u8], format: Format, dimensions: (u32, u32), layers: u32, settings: TextureSettings ) -> Texture
pub fn load_texture( &self, texture: &[u8], format: ImageFormat, layers: u32, settings: TextureSettings ) -> Result<Texture, InvalidFormatError>
sourcepub unsafe fn new_shader_from_raw(
&self,
vertex_bytes: &[u8],
fragment_bytes: &[u8]
) -> Shaders
pub unsafe fn new_shader_from_raw( &self, vertex_bytes: &[u8], fragment_bytes: &[u8] ) -> Shaders
Safety
Any wrong shaders bytes can mess up the program in a way I didn’t text before.
pub fn new_descriptor_write<T: BufferContents>( &self, buf: T, set: u32 ) -> WriteDescriptorSet
pub fn new_material_with_shaders( &self, shaders: &Shaders, settings: MaterialSettings, descriptor_bindings: Vec<WriteDescriptorSet> ) -> Material
pub fn new_material(&self, settings: MaterialSettings) -> Material
sourcepub fn new_material_from_texture(
&self,
texture: &[u8],
format: ImageFormat,
layers: u32,
settings: TextureSettings
) -> Result<Material, InvalidFormatError>
pub fn new_material_from_texture( &self, texture: &[u8], format: ImageFormat, layers: u32, settings: TextureSettings ) -> Result<Material, InvalidFormatError>
Simplification of making a texture and putting it into a material.
sourcepub fn new_material_from_raw_texture(
&self,
texture: &[u8],
format: Format,
dimensions: (u32, u32),
layers: u32,
settings: TextureSettings
) -> Material
pub fn new_material_from_raw_texture( &self, texture: &[u8], format: Format, dimensions: (u32, u32), layers: u32, settings: TextureSettings ) -> Material
Simplification of making a texture and putting it into a material.
pub fn default_textured_material(&self, texture: &Texture) -> Material
pub fn get_window(&self) -> &Window
pub fn window_dimensions(&self) -> (u32, u32)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Resources
impl Send for Resources
impl Sync for Resources
impl Unpin for Resources
impl !UnwindSafe for Resources
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.