Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gpu/gpudraw/drawer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"image/draw"
"sync"

"cogentcore.org/core/colors"
"cogentcore.org/core/gpu"
)

Expand Down Expand Up @@ -112,6 +113,9 @@ func (dw *Drawer) Start() {
dw.Lock()
defer dw.Unlock()

// always use the default background color for clearing in general
dw.System.SetClearColor(colors.ToUniform(colors.Scheme.Background))

dw.opList = dw.opList[:0]
dw.images.start()
}
Expand Down
1 change: 0 additions & 1 deletion gpu/gpudraw/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func (dw *Drawer) configSystem(gp *gpu.GPU, rd gpu.Renderer) {

dw.System = gpu.NewGraphicsSystem(gp, "gpudraw", rd)
sy := dw.System
// sy.SetClearColor(color.RGBA{50, 50, 50, 255})

// note: requires different pipelines for src vs. over draw op modes
dopl := sy.AddGraphicsPipeline("drawover")
Expand Down
2 changes: 1 addition & 1 deletion gpu/gsystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (sy *GraphicsSystem) SetGraphicsDefaults() *GraphicsSystem {
for _, pl := range sy.GraphicsPipelines {
pl.SetGraphicsDefaults()
}
sy.SetClearColor(colors.Black)
sy.SetClearColor(colors.ToUniform(colors.Scheme.Background))
sy.SetClearDepthStencil(1, 0)
return sy
}
Expand Down
Loading