logo
pub trait RendererSystem {
    fn render_type(&self) -> RendererType;
    fn max_texture_size(&self) -> i32;
    fn has_gpu(&self) -> Value<bool>;
    fn create_texture(&self, width: i32, height: i32) -> Box<dyn Texture>;
    fn graphics(&self) -> Box<dyn Graphics>;
    fn compressed_texture_formats(&self) -> Vec<AssetFormat>Notable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
    A: Allocator
; fn create_compressed_texture(
        &self,
        format: AssetFormat,
        data: Bytes
    ) -> Box<dyn Texture>; fn will_render(&self); fn did_render(&self); }
Expand description

Functions related to the device’s renderer.

Required Methods

The type of this renderer.

The maximum width and height of a Texture on this renderer, in pixels. Guaranteed to be at least 1024.

Whether the renderer currently has a GPU context. In some renderers the GPU and all its resources may be destroyed at any time by the system. On renderers that don’t need to worry about reclaiming GPU resources (Canvas) this is always true.

When this becomes false, all Textures and Graphics objects are destroyed and become invalid. When it returns to true, apps should reload its textures.

Creates a new blank texture, initialized to transparent black.

@param width The width of the texture, in pixels. @param height The height of the texture, in pixels.

@returns The new texture, or None if the GPU context is currently unavailable.

The compressed texture formats supported by this renderer.

Notifies the renderer that things are about to be drawn.

Notifies the renderer that drawing the frame is complete.

Implementors