Esempio n. 1
0
func main(f func(a App)) {
	gldriver.Main(func(s screen.Screen) {
		w, err := s.NewWindow(nil)
		if err != nil {
			log.Fatal(err)
		}
		defer w.Release()

		theApp.glctx = nil
		theApp.worker = nil // handled by shiny

		go func() {
			for range theApp.publish {
				res := w.Publish()
				theApp.publishResult <- PublishResult{
					BackBufferPreserved: res.BackBufferPreserved,
				}
			}
		}()

		go f(theApp)

		for {
			theApp.Send(convertEvent(w.NextEvent()))
		}
	})
}
Esempio n. 2
0
func main(f func(screen.Screen)) {
	gldriver.Main(f)
}