pub enum WrapMode {
    Wrap,
    Mirror,
    Clamp,
    Border,
    None,
}
Expand description

Wrap modes that affect the interpretation of s, t, and p texture coordinates in Sampler* elements.

Variants

Wrap

OpenGL symbol GL_REPEAT. Ignores the integer part of texture coordinates, using only the fractional part.

Mirror

OpenGL symbol GL_MIRRORED_REPEAT. First mirrors the texture coordinate. The mirrored coordinate is then clamped as described for Clamp.

Clamp

OpenGL symbol GL_CLAMP_TO_EDGE. Clamps texture coordinates at all mipmap levels such that the texture filter never samples a border texel. Note: GL_CLAMP takes any texels beyond the sampling border and substitutes those texels with the border color. So CLAMP_TO_EDGE is more appropriate. This also works much better with OpenGL ES where the GL_CLAMP symbol was removed from the OpenGL ES specification.

Border

OpenGL symbol GL_CLAMP_TO_BORDER. Clamps texture coordinates at all MIPmaps such that the texture filter always samples border texels for fragments whose corresponding texture coordinate is sufficiently far outside the range [0, 1].

None

The defined behavior for None is consistent with decal texturing where the border is black. Mapping this calculation to GL_CLAMP_TO_BORDER is the best approximation of this.

Implementations

The XML name of a value in this enumeration.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.