mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
Revert "internal/graphics: refactoring"
This reverts commit b6cc164e96
.
Reason: wrong shader program
This commit is contained in:
parent
b6cc164e96
commit
c6e5582c56
@ -99,12 +99,6 @@ func imageSrc%[1]dAt(pos vec2) vec4 {
|
|||||||
step(__textureSourceRegionOrigin.y, pos.y) *
|
step(__textureSourceRegionOrigin.y, pos.y) *
|
||||||
(1 - step(__textureSourceRegionOrigin.y + __textureSourceRegionSize.y, pos.y))
|
(1 - step(__textureSourceRegionOrigin.y + __textureSourceRegionSize.y, pos.y))
|
||||||
}
|
}
|
||||||
|
|
||||||
var __projectionMatrix mat4
|
|
||||||
|
|
||||||
func __vertex(position vec2, texCoord vec2, color vec4) (vec4, vec2, vec4) {
|
|
||||||
return __projectionMatrix * vec4(position, 0, 1), texCoord, color
|
|
||||||
}
|
|
||||||
`, i, pos)
|
`, i, pos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -113,6 +107,12 @@ func CompileShader(src []byte) (*shaderir.Program, error) {
|
|||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
buf.Write(src)
|
buf.Write(src)
|
||||||
buf.WriteString(shaderSuffix)
|
buf.WriteString(shaderSuffix)
|
||||||
|
buf.WriteString(`var __projectionMatrix mat4
|
||||||
|
|
||||||
|
func __vertex(position vec2, texCoord vec2, color vec4) (vec4, vec2, vec4) {
|
||||||
|
return __projectionMatrix * vec4(position, 0, 1), texCoord, color
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
||||||
fs := token.NewFileSet()
|
fs := token.NewFileSet()
|
||||||
f, err := parser.ParseFile(fs, "", buf.Bytes(), parser.AllErrors)
|
f, err := parser.ParseFile(fs, "", buf.Bytes(), parser.AllErrors)
|
||||||
|
Loading…
Reference in New Issue
Block a user