From 8a9e39bf6d941eb75457dd9658987b78807f743d Mon Sep 17 00:00:00 2001 From: gucio321 Date: Thu, 23 Nov 2023 09:40:40 +0100 Subject: [PATCH] fix example --- examples/main.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/main.go b/examples/main.go index 829e0428e..b92391e16 100644 --- a/examples/main.go +++ b/examples/main.go @@ -21,7 +21,7 @@ var ( a float32 color4 [4]float32 = [4]float32{r, g, b, a} selected bool - backend imgui.Backend[backends.SDLWindowFlags] + backend imgui.Backend[backends.GLFWWindowFlags] img *image.RGBA texture *imgui.Texture barValues []int64 @@ -121,7 +121,7 @@ func main() { barValues = append(barValues, int64(i+1)) } - backend = imgui.CreateBackend(backends.NewSDLBackend()) + backend = imgui.CreateBackend(backends.NewGLFWBackend()) backend.SetAfterCreateContextHook(afterCreateContext) backend.SetBeforeDestroyContextHook(beforeDestroyContext) @@ -133,11 +133,9 @@ func main() { fmt.Printf("drop triggered: %v", p) }) - /* - backend.SetCloseCallback(func(b imgui.Backend[imgui.GLFWWindowFlags]) { - fmt.Println("window is closing") - }) - */ + backend.SetCloseCallback(func(b imgui.Backend[backends.GLFWWindowFlags]) { + fmt.Println("window is closing") + }) backend.SetIcons(img)