mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
gpu: don't automatically clear screen before rendering
Gio UI may be overlaid on top of custom graphics such as in the glfw example. That will only work if Gio doesn't clear the screen (to white). Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -4,6 +4,7 @@ package app
|
||||
|
||||
import (
|
||||
"image"
|
||||
"image/color"
|
||||
"runtime"
|
||||
|
||||
"gioui.org/app/internal/window"
|
||||
@@ -85,6 +86,7 @@ func (l *renderLoop) renderLoop(ctx window.Context) error {
|
||||
l.refreshErr <- ctx.MakeCurrent()
|
||||
case frame := <-l.frames:
|
||||
ctx.Lock()
|
||||
g.Clear(color.NRGBA{A: 0xff, R: 0xff, G: 0xff, B: 0xff})
|
||||
g.Collect(frame.viewport, frame.ops)
|
||||
// Signal that we're done with the frame ops.
|
||||
l.ack <- struct{}{}
|
||||
|
||||
Reference in New Issue
Block a user