2013-12-02 16:15:01 +01:00
|
|
|
package graphics
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
|
|
|
)
|
|
|
|
|
2013-12-03 15:24:34 +01:00
|
|
|
type TextureCreatedEvent struct {
|
|
|
|
Tag string
|
|
|
|
Id TextureId
|
|
|
|
Error error
|
|
|
|
}
|
|
|
|
|
|
|
|
type RenderTargetCreatedEvent struct {
|
|
|
|
Tag string
|
|
|
|
RenderTargetId RenderTargetId
|
|
|
|
Error error
|
|
|
|
}
|
|
|
|
|
|
|
|
type TextureFactoryEvents interface {
|
|
|
|
TextureCreated() <-chan TextureCreatedEvent
|
|
|
|
RenderTargetCreated() <-chan RenderTargetCreatedEvent
|
|
|
|
}
|
|
|
|
|
2013-12-02 16:15:01 +01:00
|
|
|
type TextureFactory interface {
|
2013-12-03 15:24:34 +01:00
|
|
|
CreateRenderTarget(tag string, width, height int) (RenderTargetId, error)
|
|
|
|
CreateTextureFromImage(tag string, img image.Image) (TextureId, error)
|
|
|
|
//TextureFactoryEvents
|
2013-12-02 16:15:01 +01:00
|
|
|
}
|