From 302e5e888f0c07e49414f05033144647d7b0ee49 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 18 Jun 2022 15:18:49 +0300 Subject: [PATCH] Support gfx::texture::mirrored_repeat --- libs/gfx/include/psemek/gfx/texture.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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() {