hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
10.88k stars 651 forks source link

Kage's `min` and `max` should take arbitrary number of arguments to align with Go 1.21 #2677

Open hajimehoshi opened 1 year ago

hajimehoshi commented 1 year ago

Operating System

What feature would you like to be added?

Go 1.21 introduces min and max: https://tip.golang.org/ref/spec#Min_and_max

On the other hand, Kage already has min and max for scalar and vector values: https://ebitengine.org/en/documents/shader.html#Built-in_functions_(mathematics)

The point is

Why is this needed?

n/a

qchencd commented 1 year ago

some typo Go 1.21 introduces min and max, not 1.12

hajimehoshi commented 1 year ago

Updated, thanks!

hajimehoshi commented 7 months ago

In GLSL, this is technically allowed:

min(vec2(0), 1.0)