-
struct
SGFXAPI::TextureSampler¶ Describes how the GPU should sample the texture.
See OpenGL 3.3 Sampler Objects: Control your Texture Units
Usage:
auto sampler = std::make_shared<TextureSampler>(); // the texture should wrap around in the u-direction sampler->addressU = TextureAddressMode::TextureAddressWrap; // the texture should take the border-value if it goes over the texture border in the v-direction. sampler->addressV = TextureAddressMode::TextureAddressBorderClamp; sampler->GenerateParams(); auto mesh_texture = std::make_shared<MeshTexture>(texture, texture_unit, sampler, sampler_name);
- See
- getHandle(const TextureSampler&)
Public Functions
-
TextureSampler(const TextureSampler&)¶
-
TextureSampler &
operator=(const TextureSampler&)¶
-
TextureSampler()¶
-
~TextureSampler()¶
-
void
GenerateParams()¶ This should be called after construction, and/or after changing any member values and before using this object for rendering.
GenerateParams() “saves” the values to the GPU-side.
Public Members
-
TextureAddressMode
addressU¶
-
TextureAddressMode
addressV¶
-
TextureAddressMode
addressW¶
-
TextureFilterMode
minFilter¶
-
TextureFilterMode
mipFilter¶
-
TextureFilterMode
magFilter¶
-
std::unique_ptr<TextureSamplerPimpl>
pimpl¶