#[non_exhaustive]pub enum MaterialWrapMode {
Repeat,
ClampToEdge,
Automatic,
}
Expand description
The wrap mode specifies what happens when texture coordinates
outside the range 0→1 are used. Note that if the filter mode is
anything but MaterialFilter::Nearest
then texels outside the
range 0→1 might be used even when the coordinate is exactly 0 or 1
because OpenGL will try to sample neighbouring pixels. For example
if you are trying to render the full texture then you may get
artifacts around the edges when the pixels from the other side are
merged in if the wrap mode is set to repeat.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Repeat
The texture will be repeated. This is useful for example to draw a tiled background.
ClampToEdge
The coordinates outside the range 0→1 will sample copies of the edge pixels of the texture. This is useful to avoid artifacts if only one copy of the texture is being rendered.
Automatic
Cogl will try to automatically
decide which of the above two to use. For cogl_rectangle
, it
will use repeat mode if any of the texture coordinates are
outside the range 0→1, otherwise it will use clamp to edge. For
cogl_polygon
it will always use repeat mode. For
cogl_vertex_buffer_draw
it will use repeat mode except for
layers that have point sprite coordinate generation enabled. This
is the default value.
Trait Implementations§
Source§impl Clone for MaterialWrapMode
impl Clone for MaterialWrapMode
Source§fn clone(&self) -> MaterialWrapMode
fn clone(&self) -> MaterialWrapMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MaterialWrapMode
impl Debug for MaterialWrapMode
Source§impl Display for MaterialWrapMode
impl Display for MaterialWrapMode
Source§impl<'a> FromValue<'a> for MaterialWrapMode
impl<'a> FromValue<'a> for MaterialWrapMode
Source§unsafe fn from_value(value: &Value) -> Self
unsafe fn from_value(value: &Value) -> Self
Source§impl<'a> FromValueOptional<'a> for MaterialWrapMode
impl<'a> FromValueOptional<'a> for MaterialWrapMode
Source§impl Hash for MaterialWrapMode
impl Hash for MaterialWrapMode
Source§impl Ord for MaterialWrapMode
impl Ord for MaterialWrapMode
Source§fn cmp(&self, other: &MaterialWrapMode) -> Ordering
fn cmp(&self, other: &MaterialWrapMode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for MaterialWrapMode
impl PartialEq for MaterialWrapMode
Source§impl PartialOrd for MaterialWrapMode
impl PartialOrd for MaterialWrapMode
Source§impl SetValue for MaterialWrapMode
impl SetValue for MaterialWrapMode
Source§impl StaticType for MaterialWrapMode
impl StaticType for MaterialWrapMode
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Copy for MaterialWrapMode
impl Eq for MaterialWrapMode
impl StructuralPartialEq for MaterialWrapMode
Auto Trait Implementations§
impl Freeze for MaterialWrapMode
impl RefUnwindSafe for MaterialWrapMode
impl Send for MaterialWrapMode
impl Sync for MaterialWrapMode
impl Unpin for MaterialWrapMode
impl UnwindSafe for MaterialWrapMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToSendValue for T
impl<T> ToSendValue for T
Source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
SendValue
clone of self
.