2013-12-02 16:15:01 +01:00
|
|
|
package graphics
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
|
|
|
)
|
|
|
|
|
2014-05-02 17:06:20 +02:00
|
|
|
type Filter int
|
|
|
|
|
|
|
|
const (
|
|
|
|
FilterNearest Filter = iota
|
|
|
|
FilterLinear
|
|
|
|
)
|
|
|
|
|
|
|
|
type TextureId int
|
|
|
|
|
|
|
|
// A render target is essentially same as a texture, but it is assumed that the
|
|
|
|
// all alpha of a render target is maximum.
|
|
|
|
type RenderTargetId int
|
|
|
|
|
2013-12-02 16:15:01 +01:00
|
|
|
type TextureFactory interface {
|
2014-05-03 10:50:42 +02:00
|
|
|
CreateRenderTarget(width, height int, filter Filter) (RenderTargetId, error)
|
|
|
|
CreateTexture(img image.Image, filter Filter) (TextureId, error)
|
2013-12-02 16:15:01 +01:00
|
|
|
}
|