diff options
| -rw-r--r-- | config.go | 2 | ||||
| -rw-r--r-- | main.go | 14 | ||||
| -rw-r--r-- | stdin.go | 10 |
3 files changed, 20 insertions, 6 deletions
@@ -38,10 +38,12 @@ func parseFlags() { var width int var height int var glDrift float64 + var guiJunk string flag.StringVar(&version, "version", "v0.1", "Set compiled in version string") flag.StringVar(&filename, "filename", "seascape.glsl", "path to GLSL file") + flag.StringVar(&guiJunk, "gui", "something", "redo all this code") flag.IntVar(&width, "width", 1024, "Width of the OpenGL Window") flag.IntVar(&height, "height", 768, "Height of the OpenGL Window") @@ -14,6 +14,7 @@ import ( "go.wit.com/toolkits/tree" "github.com/faiface/pixel/pixelgl" + "github.com/gookit/config" ) //go:embed *.glsl @@ -39,9 +40,10 @@ func init() { showOptions() - // This parses the command line arguments - parseConfig() - + config.Set("width", 640) + config.Set("height", 480) + config.Set("glDrift", 0.01) + config.Set("filename", "seascape.glsl") pixelgl.Run(run) go simpleStdin() @@ -51,7 +53,11 @@ func init() { // I assume it's for testing the code in a stand alone way func main() { // This parses the command line arguments - parseConfig() + // parseConfig() + config.Set("width", 1024) + config.Set("height", 768) + config.Set("glDrift", 0.01) + config.Set("filename", "seascape.glsl") pixelgl.Run(run) } @@ -8,6 +8,8 @@ import ( "strconv" "strings" + "github.com/faiface/pixel/pixelgl" + "github.com/gookit/config" "go.wit.com/log" "go.wit.com/toolkits/tree" "go.wit.com/widget" @@ -18,7 +20,7 @@ func showOptions() { fmt.Println("Enter:") fmt.Println("'l': list all widgets") fmt.Println("'b': for buttons") - fmt.Println("'g': load gocui plugin") + fmt.Println("'g': try opengl") fmt.Println("'a': load andlabs plugin") fmt.Println("'d': enable debugging") fmt.Println("'p': panic plugin") @@ -57,7 +59,11 @@ func simpleStdin() { log.Log(NOW, "show buttons") tree.ShowButtons() case "g": - me.myTree.SendToolkitLoad("gocui") + config.Set("width", 1024) + config.Set("height", 768) + config.Set("glDrift", 0.01) + config.Set("filename", "seascape.glsl") + pixelgl.Run(run) case "a": me.myTree.SendToolkitLoad("andlabs") case "d": |
