本文整理汇总了Golang中golang.org/x/mobile/gl.Context.CullFace方法的典型用法代码示例。如果您正苦于以下问题:Golang Context.CullFace方法的具体用法?Golang Context.CullFace怎么用?Golang Context.CullFace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类golang.org/x/mobile/gl.Context
的用法示例。
在下文中一共展示了Context.CullFace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: onStart
func onStart(ctx gl.Context) {
env.SetPalette(material.Palette{
Primary: material.BlueGrey500,
Dark: material.BlueGrey700,
Light: material.BlueGrey100,
Accent: material.DeepOrangeA200,
})
quits = []chan struct{}{}
sig = make(snd.Discrete, len(material.ExpSig))
copy(sig, material.ExpSig)
rsig := make(snd.Discrete, len(material.ExpSig))
copy(rsig, material.ExpSig)
rsig.UnitInverse()
sig = append(sig, rsig...)
sig.NormalizeRange(0, 1)
ctx.Enable(gl.BLEND)
ctx.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
ctx.Enable(gl.CULL_FACE)
ctx.CullFace(gl.BACK)
env.Load(ctx)
for i := range boxes {
boxes[i] = env.NewMaterial(ctx)
boxes[i].SetColor(material.BlueGrey200)
}
}
示例2: onStart
func onStart(ctx gl.Context) {
ctx.Enable(gl.BLEND)
ctx.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
ctx.Enable(gl.CULL_FACE)
ctx.CullFace(gl.BACK)
if err := al.OpenDevice(buffers); err != nil {
log.Fatal(err)
}
env.Load(ctx)
env.LoadIcons(ctx)
env.LoadGlyphs(ctx)
toolbar = env.NewToolbar(ctx)
toolbar.Title.SetText("piano")
toolbar.Title.SetTextColor(material.White)
toolbar.Nav.SetIconColor(material.White)
btnLoop := env.NewButton(ctx)
toolbar.AddAction(btnLoop)
btnLoop.SetIcon(icon.AvFiberSmartRecord)
btnLoop.SetIconColor(material.White)
btnLoop.OnPress = func() {
if loop.Recording() {
btnLoop.SetIconColor(material.White)
loop.Stop()
} else {
btnLoop.SetIconColor(env.Palette().Accent)
loop.Record()
}
}
btnMetronome := env.NewButton(ctx)
toolbar.AddAction(btnMetronome)
btnMetronome.SetIcon(icon.AvSlowMotionVideo)
btnMetronome.SetIconColor(material.White)
btnMetronome.OnPress = func() {
if metronome.IsOff() {
metronome.On()
btnMetronome.SetIconColor(env.Palette().Accent)
} else {
metronome.Off()
btnMetronome.SetIconColor(material.White)
}
}
btnLowpass := env.NewButton(ctx)
toolbar.AddAction(btnLowpass)
btnLowpass.SetIcon(icon.AvSubtitles)
btnLowpass.SetIconColor(env.Palette().Accent)
btnLowpass.OnPress = func() {
lowpass.SetPassthrough(!lowpass.Passthrough())
if lowpass.Passthrough() {
btnLowpass.SetIconColor(material.White)
} else {
btnLowpass.SetIconColor(env.Palette().Accent)
}
}
btnReverb := env.NewButton(ctx)
toolbar.AddAction(btnReverb)
btnReverb.SetIcon(icon.AvSurroundSound)
btnReverb.SetIconColor(env.Palette().Accent)
btnReverb.OnPress = func() {
if reverb.IsOff() {
reverb.On()
keygain.SetAmp(snd.Decibel(-3).Amp())
btnReverb.SetIconColor(env.Palette().Accent)
} else {
reverb.Off()
keygain.SetAmp(snd.Decibel(3).Amp())
btnReverb.SetIconColor(material.White)
}
}
btnNext = env.NewFloatingActionButton(ctx)
btnNext.Mini = true
btnNext.SetColor(env.Palette().Accent)
btnNext.SetIcon(icon.AvSkipNext)
btnNext.OnPress = func() {
sndbankpos = (sndbankpos + 1) % len(sndbank)
go makekeys()
}
decor = env.NewMaterial(ctx)
decor.SetColor(material.BlueGrey900)
tseq := make(map[touch.Sequence]int)
for i := range btnkeys {
btnkeys[i] = env.NewButton(ctx)
j := i
btnkeys[i].OnTouch = func(ev touch.Event) {
switch ev.Type {
case touch.TypeBegin:
keys[j].Press()
tseq[ev.Sequence] = j
case touch.TypeMove:
// TODO drag finger off piano and it still plays, should stop
//.........这里部分代码省略.........