diff --git a/libs/gfx/include/psemek/gfx/texture.hpp b/libs/gfx/include/psemek/gfx/texture.hpp index ea2785d0..5c56764e 100644 --- a/libs/gfx/include/psemek/gfx/texture.hpp +++ b/libs/gfx/include/psemek/gfx/texture.hpp @@ -70,6 +70,7 @@ namespace psemek::gfx void anisotropy(); void repeat(); + void mirrored_repeat(); void clamp(); protected: @@ -384,6 +385,16 @@ namespace psemek::gfx if constexpr (D >= 3) gl::TexParameteri(Target, gl::TEXTURE_WRAP_R, gl::REPEAT); } + template + void basic_texture::mirrored_repeat() + { + bind(); + + if constexpr (D >= 1) gl::TexParameteri(Target, gl::TEXTURE_WRAP_S, gl::MIRRORED_REPEAT); + if constexpr (D >= 2) gl::TexParameteri(Target, gl::TEXTURE_WRAP_T, gl::MIRRORED_REPEAT); + if constexpr (D >= 3) gl::TexParameteri(Target, gl::TEXTURE_WRAP_R, gl::MIRRORED_REPEAT); + } + template void basic_texture::clamp() {