mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-09-20 05:12:18 +02:00
30 lines
526 B
Go
30 lines
526 B
Go
package graphics
|
|
|
|
import (
|
|
"image"
|
|
"image/color"
|
|
)
|
|
|
|
type Device interface {
|
|
Update()
|
|
// TODO: Move somewhere
|
|
NewTexture(width, height int) Texture
|
|
NewTextureFromImage(img image.Image) Texture
|
|
}
|
|
|
|
type GraphicsContext interface {
|
|
Clear()
|
|
Fill(color color.Color)
|
|
DrawTexture(texture Texture,
|
|
srcX, srcY, srcWidth, srcHeight int,
|
|
geometryMatrix *GeometryMatrix, colorMatrix *ColorMatrix)
|
|
SetOffscreen(texture Texture)
|
|
}
|
|
|
|
type Texture interface {
|
|
Width() int
|
|
Height() int
|
|
TextureWidth() int
|
|
TextureHeight() int
|
|
}
|