From 2dadc6a7a9ed5fbf90c9d85e920f81ef377fdfd3 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 4 Oct 2020 23:48:20 +0900 Subject: [PATCH] ebiten: Make AddressUnsafe default Fixes #1228 --- image.go | 8 ++++---- internal/driver/filter.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/image.go b/image.go index f76035eb1..69c4fc63c 100644 --- a/image.go +++ b/image.go @@ -242,14 +242,14 @@ type Vertex struct { type Address int const ( + // AddressUnsafe means there is no guarantee when the texture coodinates are out of range. + AddressUnsafe Address = Address(driver.AddressUnsafe) + // AddressClampToZero means that out-of-range texture coordinates return 0 (transparent). AddressClampToZero Address = Address(driver.AddressClampToZero) // AddressRepeat means that texture coordinates wrap to the other side of the texture. AddressRepeat Address = Address(driver.AddressRepeat) - - // AddressUnsafe means there is no guarantee when the texture coodinates are out of range. - AddressUnsafe Address = Address(driver.AddressUnsafe) ) // DrawTrianglesOptions represents options for DrawTriangles. @@ -270,7 +270,7 @@ type DrawTrianglesOptions struct { Filter Filter // Address is a sampler address mode. - // The default (zero) value is AddressClampToZero. + // The default (zero) value is AddressUnsafe. Address Address } diff --git a/internal/driver/filter.go b/internal/driver/filter.go index e37e0b639..187e19c08 100644 --- a/internal/driver/filter.go +++ b/internal/driver/filter.go @@ -25,7 +25,7 @@ const ( type Address int const ( - AddressClampToZero Address = iota + AddressUnsafe Address = iota + AddressClampToZero AddressRepeat - AddressUnsafe )