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-03 15:24:34 +01:00
|
|
|
type TextureCreatedEvent struct {
|
2013-12-08 08:19:24 +01:00
|
|
|
Tag interface{}
|
2013-12-03 15:24:34 +01:00
|
|
|
Id TextureId
|
|
|
|
Error error
|
|
|
|
}
|
|
|
|
|
|
|
|
type RenderTargetCreatedEvent struct {
|
2013-12-08 08:19:24 +01:00
|
|
|
Tag interface{}
|
2013-12-07 17:35:24 +01:00
|
|
|
Id RenderTargetId
|
|
|
|
Error error
|
2013-12-03 15:24:34 +01:00
|
|
|
}
|
|
|
|
|
2013-12-02 16:15:01 +01:00
|
|
|
type TextureFactory interface {
|
2014-01-11 10:07:12 +01:00
|
|
|
CreateRenderTarget(tag interface{}, width, height int, filter Filter)
|
2013-12-18 10:05:28 +01:00
|
|
|
CreateTexture(tag interface{}, img image.Image, filter Filter)
|
2013-12-16 01:39:49 +01:00
|
|
|
Events() <-chan interface{}
|
2013-12-02 16:15:01 +01:00
|
|
|
}
|