cmd,example: update gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
layout: simplify Stack API

Similar to what a previous commit did for Flex, this change simplifies
Stack to just one Layout call:

	layout.Stack{}.Layout(gtx,
		layout.Stacked(func() {...}),
		layout.Expanded(func() {...}),
	)

Signed-off-by: Elias Naur <mail@eliasnaur.com>
op: remove operation list argument from MacroOp.Add

The ability to invoke other operation lists belongs in the new CallOp.

While we're here, make MacroOp.Add use a pointer receiver to match the
other methods.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
text: convert clip.Ops to op.CallOp

MacroOp is about to lose the ability to run a different operation list
than the one it was recorded on. Text shape caches rely on that property,
and must use the new CallOp operation added for purpose.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
layout: simplify Flex API to a single Layout call

With the simplification of MacroOp, it is now possible to simplify
the Flex API to just a single Layout method, similar to List:

	layout.Flex{}.Layout(gtx,
		layout.Rigid(func() { ... }),
		layout.Flexed(0.5, func() { ... }),
	)

Signed-off-by: Elias Naur <mail@eliasnaur.com>
op: introduce CallOp

We'd like to improve the API of Flex, Stack and similar layouts
that use MacroOps internall. Unfortunately, the

  func (m MacroOp) Add(o *Ops)

method causes the MacroOp to be allocated on the heap, ruining the
nice garbage-free property of layouts.

Fortunately, layouts don't need the feature that caused the heap
allocation: invoking operation lists different than the current.

CallOp separates the invoke-different-list semantic from MacroOp,
in preparation for removing the feature from MacroOp.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/internal/gl: gofmt -w -s

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/internal/gpu: re-add check for GL_EXT_color_buffer_half_float

As noted in #49, GL_EXT_color_buffer_half_float is required for
GL_OES_texture_half_float to be useful for FBOs.

Updates #49

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/internal/gpu: use single channel floating point FBO if possible

Remove dependency on EXT_color_buffer_half_float, it's not clear it's
necessary. In any case the following FBO sanity check will catch invalid
FBO format combinations.

Updates #49

Signed-off-by: Elias Naur <mail@eliasnaur.com>
Revert "LICENSE: merge UNLICENSE and LICENSE-MIT to please license identifiers"

This reverts commit b74f2d2d1cb74406f8a2f5a6aad9c9fdb16f2cea.

Reason: the merging was done to please the license detection library
underlying pkg.go.dev. Since pkg.go.dev treats dual licensed projects
as the intersection ("AND") of the licenses, and because the UNLICENSE
is not supported per

	https://pkg.go.dev/license-policy

revert to the usual once-license-per-file.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
cmd,example: update gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/internal/gpu: query GL_EXTENSIONS correctly on macOS

macOS supports the OpenGL core profiles where glGetString(GL_EXTENSIONS)
is not supported. Use glGetStringi(GL_EXTENSIONS, <index>) instead.

The wrong query didn't make any practical difference because Gio doesn't
need any extensions on OpenGL 3 and better.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
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>
app/internal/gpu: default to color material

Before this change the default material were a texture, which leads
to a crash when no texture is current.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
.gitattributes: disable Windows line ending conversion

Signed-off-by: Elias Naur <mail@eliasnaur.com>
layout: don't allow overlapping Flex and Stack layouts

Overlapping layouts such as

	outer := layout.Flex{}
	inner := layout.Stack{}
	child := inner.Rigid(gtx, ...)
	outerChild := outer.Rigid(gtx, func() {
		inner.Layout(gtx, child)
	})
	outer.Layout(gtx, outerChild)

runs but result in a wrong layout.

This change use empty StackOps to ensure that the Stack and Flex
child layout methods are called in the same scope as their Layout
methods:

	outer := layout.Flex{}
	inner := layout.Stack{}
	outerChild := outer.Rigid(gtx, func() {
		child := inner.Rigid(gtx, ...)
		inner.Layout(gtx, child)
	})
	outer.Layout(gtx, outerChild)

Signed-off-by: Elias Naur <mail@eliasnaur.com>
op: tighten stack checks

Assign (per-frame) unique ids to each MacroOp and StackOp operations
and ensure that the pairwise Push/Pop and Record/End match.

In a follow-up change the Flex and Stack layouts will rely on those
checks to avoid being overlapped.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
op: tighten documentation

Signed-off-by: Elias Naur <mail@eliasnaur.com>
layout: move examples to example_test.go

Signed-off-by: Elias Naur <mail@eliasnaur.com>
example/kitchen: add newline after error message

Signed-off-by: Elias Naur <mail@eliasnaur.com>
Next