From dd1f79d0fad8d4922cfb8e255d85b7e4865d8331 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 10 May 2021 08:02:05 -0400 Subject: graphics: texture: Add support for mirrored repeat wrap mode. --- chickadee/graphics/texture.scm | 7 ++++--- doc/api.texi | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/chickadee/graphics/texture.scm b/chickadee/graphics/texture.scm index dd2a6d8..b9efd17 100644 --- a/chickadee/graphics/texture.scm +++ b/chickadee/graphics/texture.scm @@ -167,12 +167,13 @@ lower-left corner of the image, set FLIP? to #t. The generated texture uses MIN-FILTER for downscaling and MAG-FILTER for upscaling. WRAP-S and WRAP-T are symbols that control how texture access is handled for texture coordinates outside the [0, 1] range. Allowed -symbols are: repeat (the default), clamp, clamp-to-border, -clamp-to-edge. FORMAT specifies the pixel format. Currently only -32-bit RGBA format is supported." +symbols are: repeat (the default), mirrored-repeat, clamp, +clamp-to-border, clamp-to-edge. FORMAT specifies the pixel format. +Currently only 32-bit RGBA format is supported." (define (gl-wrap mode) (match mode ('repeat (texture-wrap-mode repeat)) + ('mirrored-repeat (version-1-4 mirrored-repeat)) ('clamp (texture-wrap-mode clamp)) ('clamp-to-border (texture-wrap-mode clamp-to-border-sgis)) ('clamp-to-edge (texture-wrap-mode clamp-to-edge-sgis)))) diff --git a/doc/api.texi b/doc/api.texi index da05e62..8a06690 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -1851,8 +1851,8 @@ respectively. Possible values are @code{nearest} and @code{linear}. @var{wrap-s} and @var{wrap-t} describe how to interpret texture coordinates that are greater than @code{1.0}. Possible values are -@code{repeat}, @code{clamp}, @code{clamp-to-border}, and -@code{clamp-to-edge}. +@code{repeat}, @code{mirrored-repeat}, @code{clamp}, +@code{clamp-to-border}, and @code{clamp-to-edge}. For color-keyed images (images where a specific color should be made transparent), specify the appropriate @var{transparent-color}. -- cgit v1.2.3