2023-05-22 23:39:01 +03:00
|
|
|
package gx
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hajimehoshi/ebiten/v2"
|
|
|
|
//"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Shader = ebiten.Shader
|
|
|
|
|
|
|
|
var (
|
|
|
|
// The shader does not
|
2023-05-23 16:19:55 +03:00
|
|
|
SolidWhiteColorShader = MustNewShader([]byte(`
|
2023-05-22 23:39:01 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
func Fragment(p vec4, coord vec2, color vec4) vec4 {
|
2023-05-23 16:19:55 +03:00
|
|
|
return vec4(1, 1, 1, 1)
|
2023-05-22 23:39:01 +03:00
|
|
|
}
|
|
|
|
`))
|
|
|
|
)
|
|
|
|
|
|
|
|
func MustNewShader(src []byte) (*Shader) {
|
|
|
|
shader, err := NewShader(src)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return shader
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewShader(src []byte) (*Shader, error) {
|
|
|
|
return ebiten.NewShader(src)
|
|
|
|
}
|
|
|
|
|