[][src]Struct screen_13::gpu::Gpu

pub struct Gpu { /* fields omitted */ }

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]

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]

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]

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]

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]

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]

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]

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]

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]

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.

NOTE: This function uses 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]

Constructs a Render of the given dimensions, using the provided cache.

Examples:

use screen_13::prelude_all::*;

#[derive(Default)]
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

impl Drop for Gpu[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.