mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
app/headless: prepare OpenGL context on macOS
The macOS backend uses a desktop OpenGL context, not a OpenGL ES context. The main difference is that sRGB have to be enabled and a vertex buffer must be bound. Do that and fix Window.Screenshot for scenes more complex than a glClear. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -22,9 +22,10 @@ func TestHeadless(t *testing.T) {
|
||||
col := color.RGBA{A: 0xff, R: 0xcc, G: 0xcc}
|
||||
var ops op.Ops
|
||||
paint.ColorOp{Color: col}.Add(&ops)
|
||||
// Paint only part of the screen to avoid the glClear optimization.
|
||||
paint.PaintOp{Rect: f32.Rectangle{Max: f32.Point{
|
||||
X: float32(sz.X),
|
||||
Y: float32(sz.Y),
|
||||
X: float32(sz.X) - 100,
|
||||
Y: float32(sz.Y) - 100,
|
||||
}}}.Add(&ops)
|
||||
w.Frame(&ops)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user