[−][src]Struct screen_13::gpu::Gpu
Allows you to load resources and begin rendering operations.
Implementations
impl Gpu
[src]
pub fn offscreen() -> Self
[src]
Creates a Gpu
for off-screen or headless use.
NOTE: Resources loaded or read from a Gpu
created in headless or screen modes cannot be
used with other instances, including of the same mode. This is a limitation only because
the code to share the resources properly has not be started yet.
pub fn load_bitmap(
&self,
pixel_ty: BitmapFormat,
pixels: &[u8],
width: u32,
stride: u32
) -> Bitmap
[src]
&self,
pixel_ty: BitmapFormat,
pixels: &[u8],
width: u32,
stride: u32
) -> Bitmap
Loads a bitmap at runtime from the given data.
pub fn load_indexed_model<M: IntoIterator<Item = Mesh>, I: IntoIterator<Item = u32>, V: IntoIterator<Item = VV>, VV: Copy + Into<Vertex>>(
&self,
meshes: M,
_indices: I,
_vertices: V
) -> Result<Model, BadData>
[src]
&self,
meshes: M,
_indices: I,
_vertices: V
) -> Result<Model, BadData>
Loads an indexed model at runtime from the given data.
pub fn load_model<IM: IntoIterator<Item = M>, IV: IntoIterator<Item = V>, M: Into<Mesh>, V: Copy + Into<Vertex>>(
&self,
meshes: IM,
vertices: IV
) -> Result<Model, BadData>
[src]
&self,
meshes: IM,
vertices: IV
) -> Result<Model, BadData>
Loads a regular model at runtime from the given data.
pub fn read_animation<R: Read + Seek>(
&self,
_name: &str,
_pak: &mut Pak<R>,
_id: AnimationId
) -> ModelRef
[src]
&self,
_name: &str,
_pak: &mut Pak<R>,
_id: AnimationId
) -> ModelRef
Reads the Animation
with the given id from the pak.
pub fn read_bitmap<K: AsRef<str>, R: Read + Seek>(
&self,
pak: &mut Pak<R>,
key: K
) -> Bitmap
[src]
&self,
pak: &mut Pak<R>,
key: K
) -> Bitmap
Reads the Bitmap
with the given key from the pak.
pub fn read_bitmap_with_id<R: Read + Seek>(
&self,
pak: &mut Pak<R>,
id: BitmapId
) -> Bitmap
[src]
&self,
pak: &mut Pak<R>,
id: BitmapId
) -> Bitmap
Reads the Bitmap
with the given id from the pak.
pub fn read_font<F: AsRef<str>, R: Read + Seek>(
&self,
pak: &mut Pak<R>,
face: F
) -> Font
[src]
&self,
pak: &mut Pak<R>,
face: F
) -> Font
Reads the Font
with the given face from the pak.
Only bitmapped fonts are supported.
pub fn read_model<K: AsRef<str>, R: Read + Seek>(
&self,
pak: &mut Pak<R>,
key: K
) -> Model
[src]
&self,
pak: &mut Pak<R>,
key: K
) -> Model
Reads the Model
with the given key from the pak.
pub fn read_model_with_id<R: Read + Seek>(
&self,
pak: &mut Pak<R>,
id: ModelId
) -> Model
[src]
&self,
pak: &mut Pak<R>,
id: ModelId
) -> Model
Reads the Model
with the given id from the pak.
pub fn render<D: Into<Extent>>(&self, dims: D) -> Render
[src]
Constructs a Render
of the given dimensions.Default
NOTE: This function will use an internal cache.
Examples:
use screen_13::prelude_all::*; struct Foo; impl Screen for Foo { fn render(&self, gpu: &Gpu, dims: Extent) -> Render { let frame = gpu.render(dims); ... } ... }
pub fn render_with_cache<D: Into<Extent>>(
&self,
dims: D,
cache: &Cache
) -> Render
[src]
&self,
dims: D,
cache: &Cache
) -> Render
Constructs a Render
of the given dimensions, using the provided cache.
Examples:
use screen_13::prelude_all::*; struct Foo(Cache); impl Screen for Foo { fn render(&self, gpu: &Gpu, dims: Extent) -> Render { let cache = &self.0; let frame = gpu.render(dims, cache); ... } ... }
pub fn resolve(&self, render: Render) -> Lease<Texture2d>
[src]
Resolves a render into a texture which can be written to other renders.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Gpu
[src]
impl !Send for Gpu
[src]
impl !Sync for Gpu
[src]
impl Unpin for Gpu
[src]
impl !UnwindSafe for Gpu
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,