diff --git a/platform/imgui/imgui.go b/platform/imgui/imgui.go index 2d91d60..6a2f891 100644 --- a/platform/imgui/imgui.go +++ b/platform/imgui/imgui.go @@ -74,3 +74,11 @@ func NextColumn() { func ShowDemoWindow() { C.igShowDemoWindow(nil) } + +func SetNextWindowPos(pos math.Vec2i) { + C.igSetNextWindowPos(C.ImVec2{x: C.float(pos.X), y: C.float(pos.Y)}, C.ImGuiCond_FirstUseEver, C.ImVec2{}) +} + +func SetNextWindowSize(size math.Vec2i) { + C.igSetNextWindowSize(C.ImVec2{x: C.float(size.X), y: C.float(size.Y)}, C.ImGuiCond_FirstUseEver) +} diff --git a/tools/viewer/viewer.go b/tools/viewer/viewer.go index 1f613d1..e8207e9 100644 --- a/tools/viewer/viewer.go +++ b/tools/viewer/viewer.go @@ -66,6 +66,8 @@ func (s *scene) Advance() error { } } + imgui.SetNextWindowSize(math.Vec2i{X: 300, Y: 400}) + imgui.Begin("DC6 Viewer") imgui.Image(s.texture) direction := s.animation.Directions[directionIndex] @@ -82,10 +84,6 @@ func (s *scene) Advance() error { imgui.Text("Offset") imgui.NextColumn() imgui.Text("%+v", frame.Offset) - imgui.Columns(1) - if imgui.Button("Exit") { - platform.WindowSetScene(nil) - } imgui.End() if directionIndex != s.directionIndex || frameIndex != s.frameIndex {