Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Rotate will rotate the final image by the specified // number of degrees before writing to the framebuffer // nb: get the best performance by using a multiple of 90 Rotate int // TickFunc is the function you want to (optionally) call every time a frame // is rendered TickFunc TickFunction TickTime time.Duration }
Config defines any specific configuration for this framebuffer
type Framebuffer ¶
type Framebuffer struct {
// contains filtered or unexported fields
}
Framebuffer is an instance of a particular framebuffer, helpfully wrapping a double-buffering and hashing mechanism to help improve the experience of using a raw framebuffer
func NewFramebuffer ¶
func NewFramebuffer(cfg *Config) (*Framebuffer, error)
NewFramebuffer will create a new Framebuffer with the given configuration
func (*Framebuffer) Bounds ¶
func (fb *Framebuffer) Bounds() image.Rectangle
Bounds returns the size of the framebuffer
func (*Framebuffer) Clear ¶
func (fb *Framebuffer) Clear(c color.Color)
Clear will clear the framebuffer with the specified colour
func (*Framebuffer) Draw ¶
func (fb *Framebuffer) Draw() *gg.Context
Draw will return a context for drawing on the framebuffer
func (*Framebuffer) ForceDraw ¶
func (fb *Framebuffer) ForceDraw()
ForceDraw will force a redraw on the next frame
func (*Framebuffer) Randomize ¶
func (fb *Framebuffer) Randomize() error
Randomize will fill the framebuffer with random data
func (*Framebuffer) Start ¶
func (fb *Framebuffer) Start(fps int) chan bool
Start will run the framebuffer render in the background and will return a chan that can be written to to stop the render loop
type TickFunction ¶
type TickFunction func(*Framebuffer)
TickFunction is a function that is called every tick to build or change the buffered image