ebiten/graphics/context.go

39 lines
624 B
Go
Raw Normal View History

2013-12-02 13:45:10 +01:00
package graphics
import (
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
)
2014-05-02 17:06:20 +02:00
type Rect struct {
X int
Y int
Width int
Height int
}
type TexturePart struct {
LocationX int
LocationY int
Source Rect
}
2014-05-01 15:45:48 +02:00
type Drawer interface {
Draw(geometryMatrix matrix.Geometry,
2013-12-02 13:45:10 +01:00
colorMatrix matrix.Color)
2014-05-01 15:45:48 +02:00
DrawParts(parts []TexturePart,
2013-12-02 13:45:10 +01:00
geometryMatrix matrix.Geometry,
colorMatrix matrix.Color)
2014-05-01 15:45:48 +02:00
}
type Context interface {
Clear()
Fill(r, g, b uint8)
Texture(id TextureId) Drawer
RenderTarget(id RenderTargetId) Drawer
2013-12-02 13:45:10 +01:00
ResetOffscreen()
SetOffscreen(id RenderTargetId)
// TODO: glTextureSubImage2D
2013-12-02 13:45:10 +01:00
}