iui improvements for viewer

This commit is contained in:
Alex Yatskov 2019-01-09 19:23:26 -08:00
parent 1914d490fe
commit c51f380d59
2 changed files with 10 additions and 4 deletions

View File

@ -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)
}

View File

@ -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 {