Struct peter_engine::graphics::RenderData
source · pub struct RenderData<App: PeterEngineApp + ?Sized> {
pub main_uniforms: UniformsBuffer,
pub device: Arc<Device>,
pub queue: Arc<Queue>,
pub shader: ShaderModule,
pub mipmap_gen: MipMapGen,
pub pixel_perfect_size: (u32, u32),
pub resources: AnyMap,
pub _phantom: PhantomData<App>,
}Fields§
§main_uniforms: UniformsBuffer§device: Arc<Device>§queue: Arc<Queue>§shader: ShaderModule§mipmap_gen: MipMapGen§pixel_perfect_size: (u32, u32)§resources: AnyMap§_phantom: PhantomData<App>Implementations§
source§impl<App: PeterEngineApp> RenderData<App>
impl<App: PeterEngineApp> RenderData<App>
sourcepub fn load_resources<K: ResourceKey>(&mut self)
pub fn load_resources<K: ResourceKey>(&mut self)
sourcepub fn get_resource<K: ResourceKey>(&self, key: K) -> &K::Output
pub fn get_resource<K: ResourceKey>(&self, key: K) -> &K::Output
pub fn new(cc: &CreationContext<'_>) -> Self
sourcepub fn load_texture(&self, bytes: &[u8]) -> (Texture, TextureView)
pub fn load_texture(&self, bytes: &[u8]) -> (Texture, TextureView)
Examples found in repository?
examples/test.rs (lines 21-29)
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
fn load<App: PeterEngineApp>(self, rd: &mut RenderData<App>) -> Self::Output {
match self {
Self::A =>
rd.load_texture(&[
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44,
0x52, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x66,
0xBC, 0x3A, 0x25, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4C, 0x54, 0x45, 0xB5, 0xD0, 0xD0, 0x63,
0x04, 0x16, 0xEA, 0x00, 0x00, 0x00, 0x1F, 0x49, 0x44, 0x41, 0x54, 0x68, 0x81, 0xED, 0xC1,
0x01, 0x0D, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0xF7, 0x4F, 0x6D, 0x0E, 0x37, 0xA0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0x0D, 0x21, 0x00, 0x00, 0x01, 0x9A, 0x60, 0xE1,
0xD5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
])
.1,
}
}Trait Implementations§
impl<App: PeterEngineApp> Send for RenderData<App>
impl<App: PeterEngineApp> Sync for RenderData<App>
Auto Trait Implementations§
impl<App> !RefUnwindSafe for RenderData<App>
impl<App: ?Sized> Unpin for RenderData<App>where
App: Unpin,
impl<App> !UnwindSafe for RenderData<App>
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> 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.