ebiten/graphics/graphics.go

34 lines
568 B
Go
Raw Normal View History

2013-06-19 01:49:54 +02:00
package graphics
import (
"image"
"image/color"
)
type Device interface {
Update()
2013-06-19 16:08:24 +02:00
TextureFactory() TextureFactory
2013-06-19 01:49:54 +02:00
}
type GraphicsContext interface {
Clear()
Fill(color color.Color)
2013-06-19 16:08:24 +02:00
DrawTexture(textureId TextureID,
2013-06-19 01:49:54 +02:00
srcX, srcY, srcWidth, srcHeight int,
geometryMatrix *GeometryMatrix, colorMatrix *ColorMatrix)
2013-06-19 16:08:24 +02:00
SetOffscreen(textureId TextureID)
}
type TextureFactory interface {
NewTexture(width, height int) Texture
NewTextureFromImage(img image.Image) Texture
2013-06-19 01:49:54 +02:00
}
2013-06-19 03:31:44 +02:00
type Texture struct {
2013-06-19 16:51:41 +02:00
ID TextureID
Width int
2013-06-19 03:31:44 +02:00
Height int
}
2013-06-19 16:08:24 +02:00
type TextureID int