diff options
Diffstat (limited to 'termui/render.go')
-rw-r--r-- | termui/render.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/termui/render.go b/termui/render.go index 92a277a..52bcdf3 100644 --- a/termui/render.go +++ b/termui/render.go @@ -6,19 +6,14 @@ import ( tb "github.com/nsf/termbox-go" ) -var renderJobs chan []Bufferer - -// So that only one render function can flush/write to the screen at a time -// var renderLock sync.Mutex - -// Bufferer should be implemented by all renderable components. Bufferers can render a Buffer. +// Bufferer should be implemented by all renderable components. type Bufferer interface { Buffer() *Buffer GetXOffset() int GetYOffset() int } -// Render renders all Bufferer in the given order from left to right, right could overlap on left ones. +// Render renders all Bufferers in the given order to termbox, then asks termbox to print the screen. func Render(bs ...Bufferer) { var wg sync.WaitGroup for _, b := range bs { @@ -35,13 +30,11 @@ func Render(bs ...Bufferer) { }(b) } - // renderLock.Lock() - wg.Wait() tb.Flush() - // renderLock.Unlock() } +// Clear clears the screen with the default Bg color. func Clear() { tb.Clear(tb.ColorDefault+1, tb.Attribute(Theme.Bg)+1) } |