From 96149ee38b1053737874fabb4cf1678865e358ef Mon Sep 17 00:00:00 2001 From: saji Date: Sat, 27 May 2023 22:06:05 -0500 Subject: [PATCH] added cimgui-go --- cmd/gotelem/cli/client.go | 14 ++++++++++++++ go.mod | 2 +- go.sum | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cmd/gotelem/cli/client.go b/cmd/gotelem/cli/client.go index e8e4ea2..b5a0ca8 100644 --- a/cmd/gotelem/cli/client.go +++ b/cmd/gotelem/cli/client.go @@ -6,6 +6,7 @@ import ( "github.com/kschamplin/gotelem" "github.com/kschamplin/gotelem/mprpc" "github.com/urfave/cli/v2" + imgui "github.com/AllenDang/cimgui-go" ) @@ -29,6 +30,19 @@ var clientCmd = &cli.Command{ Description: ` Connects to a gotelem server or relay. Can be used to `, + Action: client, +} + + +func loop() { + imgui.ShowDemoWindow() +} + +func client(ctx *cli.Context) error { + backend := imgui.CreateBackend() + backend.CreateWindow("hi there", 1200, 900, 0) + backend.Run(loop) + return nil } diff --git a/go.mod b/go.mod index 0cd6391..b6ced54 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/kschamplin/gotelem go 1.20 require ( + github.com/AllenDang/cimgui-go v0.0.0-20230502145512-97518c13c52b github.com/jmoiron/sqlx v1.3.5 github.com/mattn/go-sqlite3 v1.14.16 github.com/tinylib/msgp v1.1.8 @@ -19,5 +20,4 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/stretchr/testify v1.8.0 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 0613206..ce96a2f 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/AllenDang/cimgui-go v0.0.0-20230502145512-97518c13c52b h1:EpLVWHcO5auIf8X0STrno4WAWThu6s6QgJ1ywJa5Tmo= +github.com/AllenDang/cimgui-go v0.0.0-20230502145512-97518c13c52b/go.mod h1:iNfbIyOBN8k3XScMxULbrwYbPsXEAUD0Jb6UwrspQb8= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0=