This is a snapshot of a work-in-progress documentation theme. If you feel lost, miss something, or want to see the original Doxygen docs instead, head over to the archived version of this documentation page.

Magnum::Sampler class

Texture sampler.

Public types

enum class Filter: GLint { Nearest = 0x2600, Linear = 0x2601 }
Texture filtering.
enum class Mipmap: GLint { Base = 0x2600 & ~ 0x2600, Nearest = 0x2700 & ~ 0x2600, Linear = 0x2702 & ~ 0x2600 }
Mip level selection.
enum class Wrapping: GLint { Repeat = 0x2901, MirroredRepeat = 0x8370, ClampToEdge = 0x812F, ClampToBorder = 0x812D, MirrorClampToEdge = 0x8743 }
Texture wrapping.
enum class CompareMode: GLenum { None = 0, CompareRefToTexture = 0x884E }
Depth texture comparison mode.
enum class CompareFunction: GLenum { Never = 0x0200, Always = 0x0207, Less = 0x0201, LessOrEqual = 0x0203, Equal = 0x0202, NotEqual = 0x0205, GreaterOrEqual = 0x0206, Greater = 0x0204 }
Depth texture comparison function.
enum class DepthStencilMode: GLenum { DepthComponent = 0x1902, StencilIndex = 0x1901 }
Depth/stencil texture mode.

Public static functions

static auto maxMaxAnisotropy() -> Float
Max supported max anisotropy.

Enum documentation

enum class Magnum::Sampler::Filter: GLint

Texture filtering.

Enumerators
Nearest

Nearest neighbor filtering

Linear

Linear interpolation filtering.

enum class Magnum::Sampler::Mipmap: GLint

Mip level selection.

Enumerators
Base

Select base mip level

Nearest

Select nearest mip level. Unavailable on rectangle textures.

Linear

Linear interpolation of nearest mip levels. Unavailable on rectangle textures.

enum class Magnum::Sampler::Wrapping: GLint

Texture wrapping.

Enumerators
Repeat

Repeat texture. Unavailable on rectangle textures.

MirroredRepeat

Repeat mirrored texture. Unavailable on rectangle textures.

ClampToEdge

Clamp to edge. Coordinates out of the range will be clamped to first / last column / row in given direction.

ClampToBorder

Clamp to border color. Coordinates out of range will be clamped to border color (set with *Texture::setBorderColor()).

MirrorClampToEdge

Mirror the texture once in negative coordinates and clamp to edge after that. Unavailable on rectangle textures.

enum class Magnum::Sampler::CompareMode: GLenum

Depth texture comparison mode.

Enumerators
None

Directly output the depth value

CompareRefToTexture

Use output from specified CompareFunction

enum class Magnum::Sampler::CompareFunction: GLenum

Depth texture comparison function.

Comparison operator used when comparison mode is set to CompareMode::CompareRefToTexture.

Enumerators
Never

Always 0.0

Always

Always 1.0

Less

1.0 when texture coordinate is less than depth value, 0.0 otherwise

LessOrEqual

1.0 when texture coordinate is less than or equal to depth value, 0.0 otherwise

Equal

1.0 when texture coordinate is equal to depth value, 0.0 otherwise

NotEqual

0.0 when texture coordinate is equal to depth value, 1.0 otherwise

GreaterOrEqual

1.0 when texture coordinate is greater than or equal to depth value, 0.0 otherwise

Greater

1.0 when texture coordinate is greater than depth value, 0.0 otherwise

enum class Magnum::Sampler::DepthStencilMode: GLenum

Depth/stencil texture mode.

Enumerators
DepthComponent

Sample depth component

StencilIndex

Sample stencil index (as unsigned integer texture)

Function documentation

static Float Magnum::Sampler::maxMaxAnisotropy()

Max supported max anisotropy.

The result is cached, repeated queries don't result in repeated OpenGL calls. If extension EXT_texture_filter_anisotropic (desktop or ES) is not available, returns 0.0f.

Debug& operator<<(Debug& debug, Sampler::Filter value)

Debug output operator.


Debug& operator<<(Debug& debug, Sampler::Mipmap value)

Debug output operator.


Debug& operator<<(Debug& debug, Sampler::Wrapping value)

Debug output operator.


Debug& operator<<(Debug& debug, Sampler::CompareMode value)

Debug output operator.


Debug& operator<<(Debug& debug, Sampler::CompareFunction value)

Debug output operator.