43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package ui
|
|
|
|
import (
|
|
"image"
|
|
"image/color"
|
|
|
|
"opslag.de/schobers/geom"
|
|
)
|
|
|
|
type Renderer interface {
|
|
// Events
|
|
PushEvents(t EventTarget, wait bool)
|
|
Refresh()
|
|
|
|
// Lifetime
|
|
Destroy() error
|
|
|
|
// Drawing
|
|
Clear(c color.Color)
|
|
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)
|
|
DefaultTarget() Texture
|
|
DrawTexture(t Texture, p geom.PointF32)
|
|
DrawTextureOptions(t Texture, p geom.PointF32, opts DrawOptions)
|
|
FillRectangle(r geom.RectangleF32, c color.Color)
|
|
Font(name string) Font
|
|
Rectangle(r geom.RectangleF32, c color.Color, thickness float32)
|
|
RegisterFont(name, path string, size int) error
|
|
RenderTo(Texture)
|
|
RenderToDisplay()
|
|
SetMouseCursor(c MouseCursor)
|
|
Size() geom.PointF32
|
|
Target() Texture
|
|
Text(p geom.PointF32, font string, color color.Color, text string)
|
|
TextAlign(p geom.PointF32, font string, color color.Color, text string, align HorizontalAlignment)
|
|
|
|
// Resources
|
|
Resources() Resources
|
|
SetResourceProvider(factory func() Resources)
|
|
}
|