Skip to content

struct

TextureRef

pub struct TextureRef {
    pub src: String,
    pub wrap: Wrap,
    pub filter: Filter,
    pub flip_y: bool,
}

An image a material samples.

Fields

src

pub src: String

The image's URL.

wrap

pub wrap: Wrap

How it repeats beyond its edges.

filter

pub filter: Filter

How it's sampled.

flip_y

pub flip_y: bool

Flip rows on upload (images are top-down; GL is bottom-up).

Methods

new

pub fn new(src: &str) -> TextureRef

A texture loaded from src: repeating, smoothly filtered, and flipped vertically as WebGL expects.

key

pub fn key(&self) -> String

The cache key: the image and how it's sampled.

Trait implementations