예제 #1
0
파일: shiny.go 프로젝트: kardianos/garage
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()))
		}
	})
}
예제 #2
0
func main(f func(screen.Screen)) {
	gldriver.Main(f)
}