zntg/allg5ui/texture.go

31 lines
430 B
Go
Raw Normal View History

package allg5ui
import (
"image"
"opslag.de/schobers/allg5"
"opslag.de/schobers/zntg/ui"
)
2020-05-12 21:03:43 +00:00
var _ ui.Texture = &texture{}
2020-05-12 21:03:43 +00:00
type texture struct {
bmp *allg5.Bitmap
}
2020-05-12 21:03:43 +00:00
func (t *texture) Destroy() {
t.bmp.Destroy()
}
2020-05-12 21:03:43 +00:00
func (t *texture) Height() float32 {
return float32(t.bmp.Height())
}
2020-05-12 21:03:43 +00:00
func (t *texture) Texture() image.Image {
return t.bmp.Image()
}
2020-05-12 21:03:43 +00:00
func (t *texture) Width() float32 {
return float32(t.bmp.Width())
}