From c51f380d5937e27a02d6cf3ae6613d208d324678 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 9 Jan 2019 19:23:26 -0800 Subject: [PATCH] iui improvements for viewer --- platform/imgui/imgui.go | 8 ++++++++ tools/viewer/viewer.go | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) 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 {