diff --git a/backends/pixel/pixel.go b/backends/pixel/pixel.go index 2b16c02..6976f40 100644 --- a/backends/pixel/pixel.go +++ b/backends/pixel/pixel.go @@ -114,13 +114,13 @@ func (backend *Backend) Resized () (resized bool) { } func (backend *Backend) draw () { - didDrawing := false + // didDrawing := false if backend.boundsDirty { backend.window.Clear ( backend.config.Color(stone.ColorApplication)) backend.boundsDirty = false - didDrawing = true + // didDrawing = true } else { // TODO: clear out dirty cells before drawing them (we don't // want to clear them out if we have already just cleared @@ -138,19 +138,26 @@ func (backend *Backend) draw () { if clean { continue } // draw cell + cell := backend.application.Cell(x, y) + content := cell.Rune() + if content < 32 { continue } - didDrawing = true // TODO: set didDrawing up there ^ + // didDrawing = true // TODO: set didDrawing up there ^ backend.application.MarkClean(x, y) } } - if didDrawing { - backend.window.SwapBuffers() - } + backend.window.SwapBuffers() } func (backend *Backend) processEvents () { + newBounds := backend.window.Bounds().Max + backend.boundsDirty = backend.previousBounds != newBounds + backend.previousBounds = newBounds + if backend.boundsDirty { + // TODO: set size of buffer + } } func (backend *Backend) calculateWindowSize () (bounds pixel.Rect) { diff --git a/buffer.go b/buffer.go index 55145b8..dbefcec 100644 --- a/buffer.go +++ b/buffer.go @@ -34,7 +34,7 @@ func (cell Cell) Style (style Style) { return } -func (cell Cell) Rune (content rune) { +func (cell Cell) Rune () (content rune) { content = cell.content return }