30 lines
663 B
Go
30 lines
663 B
Go
package gui
|
|
|
|
import (
|
|
"github.com/hajimehoshi/ebiten/v2"
|
|
"tuxpa.in/t/erm/app/darktile/gui/render"
|
|
)
|
|
|
|
// Draw renders the terminal GUI to the ebtien window. Required to implement the ebiten interface.
|
|
func (g *GUI) Draw(screen *ebiten.Image) {
|
|
//select {
|
|
//case <-g.updateChan:
|
|
// if g.keyState.AnythingPressed() {
|
|
// go func() {
|
|
// time.Sleep(time.Millisecond * 10)
|
|
// g.updateChan <- struct{}{}
|
|
// }()
|
|
// }
|
|
//default:
|
|
// return
|
|
//}
|
|
|
|
screen.Clear()
|
|
render.New(screen, g.c, g.theme, g.terminal, g.fontManager, g.popupMessages, g.opacity, g.enableLigatures, g.cursorImage).
|
|
Draw()
|
|
|
|
if g.screenshotRequested {
|
|
g.takeScreenshot(screen)
|
|
}
|
|
}
|