Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Nov 23, 2023
1 parent a0db322 commit 8a9e39b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit 8a9e39b

Please sign in to comment.