29 lines
533 B
Go
29 lines
533 B
Go
|
package main
|
||
|
|
||
|
import "github.com/nsf/termbox-go"
|
||
|
|
||
|
// Screen TODO: Comment
|
||
|
type Screen interface {
|
||
|
handleKeyEvent(event termbox.Event) int
|
||
|
performLayout(style style)
|
||
|
drawScreen(style style)
|
||
|
}
|
||
|
|
||
|
// ViewPort TODO: Comment
|
||
|
type ViewPort struct {
|
||
|
bytesPerRow int
|
||
|
numberOfRows int
|
||
|
firstRow int
|
||
|
}
|
||
|
|
||
|
func drawBackground(bg termbox.Attribute) {
|
||
|
termbox.Clear(0, bg)
|
||
|
}
|
||
|
|
||
|
func layoutAndDrawScreen(screen Screen, style style) {
|
||
|
screen.performLayout(style)
|
||
|
drawBackground(style.defaultBg)
|
||
|
screen.drawScreen(style)
|
||
|
termbox.Flush()
|
||
|
}
|