Пример #1
0
package material

// TODO fonts
// https://www.mapbox.com/blog/text-signed-distance-fields/

import (
	"dasa.cc/material/glutil"
	"dasa.cc/material/icon"
	"dasa.cc/material/simplex"
	"golang.org/x/mobile/exp/f32"
	"golang.org/x/mobile/gl"
)

var (
	DefaultFilter = glutil.TextureFilter(gl.LINEAR, gl.LINEAR)
	DefaultWrap   = glutil.TextureWrap(gl.REPEAT, gl.REPEAT)
)

type Material struct {
	Box

	col4, col8, col12 int

	BehaviorFlags Behavior

	Texture glutil.Texture
	uvbuf   glutil.FloatBuffer
	uicon   gl.Uniform

	icx, icy float32
Пример #2
0
package material

import (
	"time"

	"dasa.cc/material/glutil"
	"dasa.cc/material/icon"
	"dasa.cc/simplex"
	"golang.org/x/mobile/event/touch"
	"golang.org/x/mobile/exp/f32"
	"golang.org/x/mobile/gl"
)

var (
	DefaultFilter = glutil.TextureFilter(gl.LINEAR, gl.LINEAR)
	DefaultWrap   = glutil.TextureWrap(gl.REPEAT, gl.REPEAT)

	linearFilter  = glutil.TextureFilter(gl.LINEAR, gl.LINEAR)
	nearestFilter = glutil.TextureFilter(gl.NEAREST, gl.NEAREST)
	glyphsFilter  = glutil.TextureFilter(gl.LINEAR_MIPMAP_LINEAR, gl.LINEAR)
)

type Material struct {
	Box

	Drawer glutil.DrawerFunc

	col4, col8, col12 int

	hidden bool