2019-03-05 20:52:18 +00:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
|
|
|
"image/color"
|
|
|
|
|
|
|
|
"opslag.de/schobers/geom"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Renderer interface {
|
|
|
|
// Events
|
|
|
|
PushEvents(t EventTarget, wait bool)
|
2019-03-06 17:18:35 +00:00
|
|
|
Refresh()
|
2019-03-05 20:52:18 +00:00
|
|
|
|
|
|
|
// Lifetime
|
|
|
|
Destroy() error
|
|
|
|
|
|
|
|
// Drawing
|
|
|
|
Clear(c color.Color)
|
2020-05-15 13:42:24 +00:00
|
|
|
CreateFontPath(path string, size int) (Font, error)
|
2020-05-15 07:20:44 +00:00
|
|
|
CreateTexture(m ImageSource) (Texture, error)
|
|
|
|
CreateTextureGo(m image.Image, source bool) (Texture, error)
|
|
|
|
CreateTexturePath(path string, source bool) (Texture, error)
|
|
|
|
CreateTextureTarget(w, h float32) (Texture, error)
|
2020-05-12 21:03:43 +00:00
|
|
|
DefaultTarget() Texture
|
2020-05-17 09:12:45 +00:00
|
|
|
DrawTexture(t Texture, p geom.RectangleF32)
|
|
|
|
DrawTextureOptions(t Texture, p geom.RectangleF32, opts DrawOptions)
|
|
|
|
DrawTexturePoint(t Texture, p geom.PointF32)
|
|
|
|
DrawTexturePointOptions(t Texture, p geom.PointF32, opts DrawOptions)
|
2019-03-05 20:52:18 +00:00
|
|
|
FillRectangle(r geom.RectangleF32, c color.Color)
|
|
|
|
Rectangle(r geom.RectangleF32, c color.Color, thickness float32)
|
2020-05-12 21:03:43 +00:00
|
|
|
RenderTo(Texture)
|
2019-03-05 20:52:18 +00:00
|
|
|
RenderToDisplay()
|
2019-03-11 16:30:41 +00:00
|
|
|
SetMouseCursor(c MouseCursor)
|
2019-03-05 20:52:18 +00:00
|
|
|
Size() geom.PointF32
|
2020-05-12 21:03:43 +00:00
|
|
|
Target() Texture
|
2020-05-15 13:42:24 +00:00
|
|
|
Text(font Font, p geom.PointF32, color color.Color, text string)
|
|
|
|
TextAlign(font Font, p geom.PointF32, color color.Color, text string, align HorizontalAlignment)
|
2020-05-15 12:20:07 +00:00
|
|
|
|
|
|
|
// Resources
|
|
|
|
Resources() Resources
|
|
|
|
SetResourceProvider(factory func() Resources)
|
2019-03-05 20:52:18 +00:00
|
|
|
}
|