ebiten/graphics/graphics.go
2013-06-23 16:06:32 +09:00

53 lines
899 B
Go

package graphics
import (
"github.com/hajimehoshi/go.ebiten/graphics/matrix"
"image"
"image/color"
)
type Device interface {
Update()
TextureFactory() TextureFactory
}
type Rect struct {
X int
Y int
Width int
Height int
}
type TexturePart struct {
LocationX int
LocationY int
Source Rect
}
type GraphicsContext interface {
Clear()
Fill(color color.Color)
DrawRect(rect Rect, clr color.Color)
DrawTexture(texture Texture,
geometryMatrix matrix.Geometry,
colorMatrix matrix.Color)
DrawTextureParts(textureId TextureID,
locations []TexturePart,
geometryMatrix matrix.Geometry,
colorMatrix matrix.Color)
SetOffscreen(textureId TextureID)
}
type TextureFactory interface {
NewTexture(width, height int) Texture
NewTextureFromImage(img image.Image) (Texture, error)
}
type Texture struct {
ID TextureID
Width int
Height int
}
type TextureID int