Buffer, DamageBuffer, and Application are io.Writers
This commit is contained in:
@@ -19,6 +19,7 @@ type Backend struct {
|
||||
backgroundStamper *imdraw.IMDraw
|
||||
fontAtlas *text.Atlas
|
||||
textDrawer *text.Text
|
||||
showBounds bool
|
||||
|
||||
metrics struct {
|
||||
cellWidth int
|
||||
@@ -176,15 +177,18 @@ func (backend *Backend) draw () {
|
||||
backend.textDrawer.Draw(backend.window, pixel.IM)
|
||||
}
|
||||
}
|
||||
|
||||
backend.backgroundStamper.Clear()
|
||||
backend.backgroundStamper.Color =
|
||||
backend.config.Color(stone.ColorBackground)
|
||||
backend.backgroundStamper.Push (
|
||||
backend.vectorAtPosition(0, 0),
|
||||
backend.vectorAtPosition(width, height))
|
||||
backend.backgroundStamper.Rectangle(1)
|
||||
backend.backgroundStamper.Draw(backend.window)
|
||||
|
||||
// draw a rectangle around the buffer if we are showing bounds
|
||||
if backend.showBounds {
|
||||
backend.backgroundStamper.Clear()
|
||||
backend.backgroundStamper.Color =
|
||||
backend.config.Color(stone.ColorBackground)
|
||||
backend.backgroundStamper.Push (
|
||||
backend.vectorAtPosition(0, 0),
|
||||
backend.vectorAtPosition(width, height))
|
||||
backend.backgroundStamper.Rectangle(1)
|
||||
backend.backgroundStamper.Draw(backend.window)
|
||||
}
|
||||
|
||||
backend.window.SwapBuffers()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user