mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: Add comments about shaders
This commit is contained in:
parent
9f49e68fea
commit
88c340f32d
10
shader.go
10
shader.go
@ -103,12 +103,20 @@ func __vertex(position vec2, texCoord vec2, color vec4) (vec4, vec2, vec4) {
|
||||
`
|
||||
}
|
||||
|
||||
// Shader represents a compiled shader program.
|
||||
//
|
||||
// For the details about the shader, see https://ebiten.org/documents/shader.html.
|
||||
type Shader struct {
|
||||
shader *mipmap.Shader
|
||||
uniformNames []string
|
||||
uniformTypes []shaderir.Type
|
||||
}
|
||||
|
||||
// NewShader compiles a shader program in the shading language Kage, and retruns the result.
|
||||
//
|
||||
// If the compilation fails, NewShader returns an error.
|
||||
//
|
||||
// For the details about the shader, see https://ebiten.org/documents/shader.html.
|
||||
func NewShader(src []byte) (*Shader, error) {
|
||||
var buf bytes.Buffer
|
||||
buf.Write(src)
|
||||
@ -143,6 +151,8 @@ func NewShader(src []byte) (*Shader, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Dispose disposes the shader program.
|
||||
// After disposing, the shader is no longer available.
|
||||
func (s *Shader) Dispose() {
|
||||
s.shader.MarkDisposed()
|
||||
s.shader = nil
|
||||
|
Loading…
Reference in New Issue
Block a user