| 1 | // Copyright 2015 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Package driver provides the default driver for accessing a screen. |
| 6 | package driver // import "golang.org/x/exp/shiny/driver" |
| 7 | |
| 8 | // TODO: figure out what to say about the responsibility for users of this |
| 9 | // package to check any implicit dependencies' LICENSEs. For example, the |
| 10 | // driver might use third party software outside of golang.org/x, like an X11 |
| 11 | // or OpenGL library. |
| 12 | |
| 13 | import ( |
| 14 | "golang.org/x/exp/shiny/screen" |
| 15 | ) |
| 16 | |
| 17 | // Main is called by the program's main function to run the graphical |
| 18 | // application. |
| 19 | // |
| 20 | // It calls f on the Screen, possibly in a separate goroutine, as some OS- |
| 21 | // specific libraries require being on 'the main thread'. It returns when f |
| 22 | // returns. |
| 23 | func Main(f func(screen.Screen)) { |
| 24 | main(f) |
| 25 | } |