mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: bug fix: assigning to arguments doesn't work with OpenGL
Updates #2166
This commit is contained in:
parent
f8c4634017
commit
9bd46cb2b5
@ -1198,10 +1198,11 @@ func TestShaderDrawRect(t *testing.T) {
|
||||
|
||||
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
// Adjust texCoord into [0, 1].
|
||||
t := texCoord
|
||||
origin, size := imageSrcRegionOnTexture()
|
||||
texCoord -= origin
|
||||
texCoord /= size
|
||||
if texCoord.x >= 0.5 && texCoord.y >= 0.5 {
|
||||
t -= origin
|
||||
t /= size
|
||||
if t.x >= 0.5 && t.y >= 0.5 {
|
||||
return vec4(1, 0, 0, 1)
|
||||
}
|
||||
return vec4(0, 1, 0, 1)
|
||||
|
Loading…
Reference in New Issue
Block a user