Trait ShaderResourceExtension

Source
pub trait ShaderResourceExtension: Sized {
    // Required methods
    fn from_str(str: &str, kind: ResourceKind) -> Result<Self, ShaderError>;
    fn standard() -> Self;
    fn standard_2d() -> Self;
    fn standard_particle_system() -> Self;
    fn standard_sprite() -> Self;
    fn standard_terrain() -> Self;
    fn standard_tile() -> Self;
    fn standard_twosides() -> Self;
    fn standard_shaders() -> [&'static BuiltInResource<Shader>; 7];
}
Expand description

Extension trait for shader resources.

Required Methods§

Source

fn from_str(str: &str, kind: ResourceKind) -> Result<Self, ShaderError>

Creates new shader from given string. Input string must have the format defined in examples for ShaderResource.

Source

fn standard() -> Self

Returns an instance of standard shader.

Source

fn standard_2d() -> Self

Returns an instance of standard 2D shader.

Source

fn standard_particle_system() -> Self

Returns an instance of standard particle system shader.

Source

fn standard_sprite() -> Self

Returns an instance of standard sprite shader.

Source

fn standard_terrain() -> Self

Returns an instance of standard terrain shader.

Source

fn standard_tile() -> Self

Returns an instance of standard tile shader.

Source

fn standard_twosides() -> Self

Returns an instance of standard two-sides terrain shader.

Source

fn standard_shaders() -> [&'static BuiltInResource<Shader>; 7]

Returns a list of standard shader.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§