![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Core/GL/Sampler.h>
Sets texture sampling parameters for a specific texture unit. More...
Inheritance diagram for Sampler:Sets texture sampling parameters for a specific texture unit.
Instances of this class are usually supposed to be used together with a GL::Texture when calling GL::Program::setArgument(). You can use the same sampler for multiple textures at the same time.
Public Types | |
| enum class | Wrap { ClampToEdge = 0x812F , Repeat = 0x2901 , MirroredRepeat = 0x8370 , ClampToBorder = 0x812D } |
| Describes the wrapping mode applied by an OpenGL texture sampler. More... | |
| enum class | MinFilter { Nearest = 0x2600 , Linear = 0x2601 , NearestMipMapNearest = 0x2700 , LinearMipMapNearest = 0x2701 , NearestMipMapLinear = 0x2702 , LinearMipMapLinear = 0x2703 } |
| Describes the minification filter applied by an OpenGL texture sampler. More... | |
| enum class | MagFilter { Nearest = 0x2600 , Linear = 0x2601 } |
| Describes the magnification filter applied by an OpenGL texture sampler. More... | |
| enum class | CompareMode { None = 0 , CompareToRefTexture = 0x884E } |
| enum class | CompareFunc { Never = 0x0200 , Less = 0x0201 , Equal = 0x0202 , LesserEqual = 0x0203 , Greater = 0x0204 , NotEqual = 0x0205 , GreaterEqual = 0x0206 , Always = 0x0207 } |
Public Member Functions | |
| Sampler () | |
| Creates a sampler object using linear filtering and clamp-to-edge wrapping as default parameters. | |
| void | setFiltering (MinFilter min, MagFilter mag) |
| Sets the minification and magnification filters. | |
| void | setWrapping (Wrap s, Wrap t, Wrap r) |
| Sets the wrapping parameters for each dimension. | |
| void | setWrapping (Wrap all) |
| Sets all wrapping parameters for all dimensions to the same value. | |
| void | setCompareMode (CompareMode mode, CompareFunc func) |
| Sets compare mode for depth component textures. | |
| void | setLOD (float minLOD, float maxLOD, float bias=0.0f) |
| Sets level-of-detail parameters used in mipmap selection. | |
| void | setBorderColor (const vec4f &color) |
| Sets the border color that is used for Wrap::ClampToBorder. | |
| void | bind (uint32_t textureUnit) const |
| Binds the sampler to the specified texture unit. | |
| uint32_t | id () const |
| Return the OpenGL object ID of this sampler. | |
Static Public Member Functions | |
| static void | unbind (uint32_t textureUnit) |
| Unbinds any potentially bound sampler from the specified texture unit (binds 0) | |
|
strong |
Describes the wrapping mode applied by an OpenGL texture sampler.
|
strong |
Describes the minification filter applied by an OpenGL texture sampler.
MipMap options require mipmaps to be present in the texture, cf. GL::Texture::generateMipmaps()
|
strong |
|
strong |
|
strong |
| Sampler | ( | ) |
Creates a sampler object using linear filtering and clamp-to-edge wrapping as default parameters.
| std::runtime_error | if the corresponding OpenGL sampler object could not be created. |
Sets the minification and magnification filters.
Mipmap types will only work when the texture bound to the same texture unit has mipmap levels.