mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-02 22:14:29 +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 {
|
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||||
// Adjust texCoord into [0, 1].
|
// Adjust texCoord into [0, 1].
|
||||||
|
t := texCoord
|
||||||
origin, size := imageSrcRegionOnTexture()
|
origin, size := imageSrcRegionOnTexture()
|
||||||
texCoord -= origin
|
t -= origin
|
||||||
texCoord /= size
|
t /= size
|
||||||
if texCoord.x >= 0.5 && texCoord.y >= 0.5 {
|
if t.x >= 0.5 && t.y >= 0.5 {
|
||||||
return vec4(1, 0, 0, 1)
|
return vec4(1, 0, 0, 1)
|
||||||
}
|
}
|
||||||
return vec4(0, 1, 0, 1)
|
return vec4(0, 1, 0, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user